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.
Regex Generator & Tester
Pattern on the left, sample text on the right — matches highlight below. Templates and copy as `/pattern/flags`.
How to use this tool
Enter a regular expression and sample text, then inspect highlighted matches. Change flags or start with a template and copy the final pattern.
Understanding the result
Test both matching and non-matching examples. Flags and regular expression engines affect behavior; check the pattern in the environment where it will run.
Processing and privacy
Calculations, file conversion and text processing run in your browser. Your input is not uploaded to a conversion server. Keep source data and results separately. Some tools retain working state on this device so you can continue later.
Help improve this tool
Did this tool work the way you expected?
Send a quick report with a screenshot or example file. The tool name will be filled in for you.