Example

Test a Regex for Ticket IDs Before Cleanup

A regex testing workflow for matching support ticket IDs while rejecting similar strings that should not be changed.

The situation

A team wants to find ticket IDs such as BUG-104 and DOC-221 in copied release notes, but it must not match words such as DEBUG-104 or incomplete IDs.

Sample text

Fixed BUG-104 and DOC-221.
Do not match DEBUG-104.
Ignore BUG- and DOC-abc.

Workflow

  1. Paste examples that should match and examples that should fail into the tester.
  2. Use a word boundary and explicit prefixes: \b(BUG|DOC)-\d+\b.
  3. Review matches and capture groups before applying the pattern elsewhere.
  4. Add more negative examples from real notes before using replacement.
  5. Retest in the target app if it uses a different regex dialect.

Expected matches

BUG-104
DOC-221

Review checks

Open Regex Tester Back to examples