Regex Tester
Free online regex tester: real-time match highlighting, capture groups, all g/i/m/s/u/y flags and a syntax cheatsheet.
Data handling: common local tools process inputs in your browser; network queries, server execution and optional AI follow their separate data-use notes.
What is Regex Tester?
The worst way to learn a regex is wrong is discovering it in production. Enter a pattern and test text here and every match is highlighted in real time with capture groups listed one by one. All g/i/m/s/u/y flags are supported and a syntax cheatsheet is attached. It runs on the browser's native RegExp engine (behaving exactly like JavaScript) with protection against zero-width infinite loops.
How to Use
- Enter a regular expression and flags
- Paste the test text
- Review highlighted matches and capture groups
FAQ
- Why does . not match line breaks?
- By default . does not match \n; enable the s flag (dotAll) to match any character including newlines.
- Greedy vs non-greedy?
- Matching is greedy by default (as much as possible); adding ? after a quantifier makes it non-greedy: <.+> matches a whole line, while <.+?> stops at the first >.
- Does this regex syntax apply to other languages?
- This is the JavaScript dialect, largely similar to PCRE; advanced features like named groups and lookbehinds vary in support across languages.
Practical tutorials
- Regular Expressions for Beginners: 20 Handy Patterns and Four Debugging Tricks
A regex metacharacter cheat sheet, 20 ready-to-use patterns for emails, phone numbers, URLs, and more, plus debugging tips for greedy matching and runaway backtracking.
Related Tools
Last updated 2026-09-15