Regex Generator & Tester

Pattern on the left, sample text on the right — matches highlight below. Templates and copy as `/pattern/flags`.

Enter a JavaScript-style regex on the left, or choose a template above. Paste text on the right — matches are highlighted in the panel below and listed with their start positions. Under the pattern, each flag shows what its letter does; turn them on or off as needed. Copy saves `/pattern/flags` to the clipboard.

Add pieces without memorizing syntax

Click a chip — it is inserted where the blinking cursor is in the expression field (click the field first). If the field is not focused, the piece is added at the end.

Flags

These are JavaScript regex modifiers: single letters that change how the pattern is applied (for example, all matches or only the first). Tap a letter to turn it on or off — the meaning is always shown beside it.

  • g: Global — find every match, not only the first

  • i: Ignore case when matching letters

  • m: Multiline — ^ and $ match the start/end of each line

  • s: DotAll — . matches newline characters

  • u: Unicode — treat escapes and matching in Unicode mode

Paste or type the text you want to check. The preview below updates automatically.

Matches

No matches

Enter a test string to see highlighted matches.

Reading your site…

Checking how everything works for visitors.