Live regular expression tester with match highlighting, capture group inspection, and a built-in cheatsheet. No button needed β results update as you type.
//
Invalid regex
Flags
Test String
No pattern
Enter a pattern and test string to see matches.
Quick Patterns
Character classes
. Any character except newline
\d Digit [0-9]
\D Non-digit
\w Word char [a-zA-Z0-9_]
\W Non-word char
\s Whitespace
\S Non-whitespace
[abc]Character set
[^abc]Negated set
[a-z]Range
Anchors
^ Start of string / line
$ End of string / line
\b Word boundary
\B Non-word boundary
Quantifiers
* 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) variants
Groups & Lookarounds
(...)Capturing group
(?:..)Non-capturing group
(?=..)Positive lookahead
(?!..)Negative lookahead
(?<=.)Positive lookbehind
(?<!.)Negative lookbehind
| Alternation (or)
Escape sequences
\n Newline
\t Tab
\r Carriage return
\\ Literal backslash
Click any token to insert it into the pattern.
Advertisement
How to use
Type your regex pattern (without slashes) and toggle flags such as g, i, or m.
Paste sample text in the Test String area β matches highlight live as you type.
Inspect each match and its capture groups below, then copy the result to use elsewhere.
FAQ
This tester uses JavaScript regex syntax. Python, Java, PHP, and Go differ in subtle ways (named groups, escaping, lookbehind support). Verify your flags and engine before porting a pattern.
Enable the m flag so ^ and $ match line boundaries, and add s (dotAll) if you need . to match newlines.
Wrap the part you want in parentheses to create a capture group. Each match below shows every captured group so you can confirm your extraction works.