/
/
Flags:
g global
i case-insensitive
m multiline
s dotAll
u unicode
Matches will appear here.
How to Use
- Enter a regular expression in the pattern field (between the / delimiters).
- Set flags as needed (g=global, i=case-insensitive, m=multiline, etc.).
- Type or paste your test string in the Test String field.
- Matches are highlighted in real-time. Click the Matches tab to see each match and its captured groups.
- Use the Replace tab to preview string replacements with your regex.
Features
Live Match HighlightingMatches are highlighted as you type — no button needed.
Captured GroupsSee all captured groups for every match, numbered clearly.
Replace PreviewPreview the result of replace operations before using them in code.
Regex CheatsheetBuilt-in cheatsheet for quick reference of common patterns.
Use Cases
- Validate email addresses, phone numbers, and URLs in form inputs.
- Extract structured data from log files or unstructured text.
- Debug complex regex patterns before integrating into code.
- Learn regex syntax interactively with instant visual feedback.
- Build find-and-replace operations for text editors and scripts.
FAQ
What regex flavor does this tool use?
This tool uses JavaScript's built-in RegExp engine, which supports the ECMAScript (ES2022+) regex flavor, including named capture groups, lookaheads, and lookbehinds.
How do I use capturing groups in the Replace field?
Use $1, $2, $3 etc. to reference captured groups. For example, if your regex is (\w+)\s(\w+), you can use $2 $1 to swap two words.
Why is my regex not matching?
Common causes: missing the g flag for global matching, forgetting to escape special characters (., *, +, ?, (, ), [, ], {, }, ^, $, |, \\), or case sensitivity (add the i flag to ignore case).
Is my test data sent to any server?
No. All regex matching runs entirely in your browser using JavaScript. No data leaves your device.