Regex Tester
Write a regular expression and see matches highlighted in your test text in real time. Supports g, i, m, and s flags, capture groups, and common patterns.
Test Text
Matches
Enter a pattern above
Matches will be highlighted here instantly as you type.
Regex Cheat Sheet
Character Classes
.Any character except newline\dDigit [0-9]\DNon-digit\wWord character [a-zA-Z0-9_]\WNon-word character\sWhitespace (space, tab, newline)\SNon-whitespaceAnchors
^Start of string (or line with m)$End of string (or line with m)\bWord boundary\BNon-word boundaryQuantifiers
*0 or more (greedy)+1 or more (greedy)?0 or 1 — optional{n}Exactly n times{n,}n or more times{n,m}Between n and m times*? +? ??Lazy (non-greedy) versionsGroups & Lookarounds
(...)Capturing group(?:...)Non-capturing group(?<name>...)Named capturing group(?=...)Positive lookahead(?!...)Negative lookahead(?<=...)Positive lookbehind(?<!...)Negative lookbehindCharacter Sets
[abc]Match a, b, or c[^abc]Match anything except a, b, c[a-z]Any lowercase letter[0-9]Any digit[a-zA-Z0-9_]Same as \wAbout this tool
A fast, browser-only regex tester with live match highlighting. As you type your pattern, every match is highlighted in the test text with colour-coded markers and listed in the results panel with its position, matched string, and any capture groups. No delay, no button to click — results update on every keystroke.
Supports all four JavaScript regex flags: g (global), i (case-insensitive), m (multiline), and s (dotAll). Quick-load common patterns — Email, URL, Phone, IP Address, Date, Hex Color, UUID, ZIP Code — with one click. A full cheat sheet covering character classes, anchors, quantifiers, groups, and lookarounds is always visible at the bottom.
How to use
Enter your pattern
Type a regular expression into the pattern field. The input is shown in /pattern/flags notation. Any syntax errors are reported instantly below the field.
Toggle flags
Enable g, i, m, or s flags with the toggle buttons next to the pattern field. Flags take effect immediately — no need to re-enter your pattern.
Paste your test text
Type or paste the text you want to test in the left panel. Matches are highlighted in colour as you type. Use the common pattern chips to load a ready-made example.
Inspect the results
Each match appears in the right panel with its position, matched value, and capture groups. Click Copy Pattern to copy the pattern in /pattern/flags format for use in code.
Related tools
Frequently asked questions
Common questions about regular expressions, flags, capture groups, and how to use this tool.
