Regex Tester
Pattern
JavaScript pattern only (no surrounding slashes). Updates in real time.
Text
Matches below will highlight instantly as you type.
About the Regex Tester
Live-test JavaScript regular expressions in your browser. As you type, matches are highlighted below and a detailed text report is generated for copying or sharing.
Quick Regex Guide
- Literals & escaping: most characters match themselves. Use backslash to escape (e.g.
\.for a literal dot). - Common classes:
\ddigits,\wword chars,\swhitespace. Uppercase negates:\D,\W,\S. - Anchors:
^start,$end; withmthey apply per line. - Quantifiers:
a*0+,a+1+,a?0/1,a{2,5}range. Add?to make non-greedy:+?,*?. - Groups:
(...)capture;(?:...)non-capture; named capture(?<name>...). - Alternation:
a|bmatches either side. - Lookarounds:
(?=...)ahead,(?!...)neg-ahead,(?<=...)behind,(?<!...)neg-behind. - Flags:
gall matches,iignore case,mmultiline,sdotAll,uUnicode,ysticky,dindices.
Examples
- Email (simple):
\b(\w+)@([\w.-]+)\.(\w+)\b - ISO date:
\b(\d{4})-(\d{2})-(\d{2})\b - Price:
\$\d+(?:\.\d{2})?
Tips
- Prefer
uflag for modern text handling. - Use non-capturing groups
(?: )when you don’t need captured values. - Beware of catastrophic backtracking with nested, ambiguous quantifiers.
Related Tools
About this collection
Each page is built around one practical task. Enter what you need, review the result, and use the actions provided by the tool.
What to expect
- Inputs and results kept together
- Layouts that adapt to smaller screens
- Direct links for returning to a tool
- No account needed for the listed utilities
Need something else? Request a tool.