Regex Tester
Test JavaScript regular expressions with match highlighting, flags, replace preview, presets, and a cheat sheet.
OK
Test text
Input
Highlighted matches
Hello world!
Regex tester example.
hello WORLD
Email: test@example.com
Highlight shows the matched substrings only (not groups).
Matches (11)
Tip: try named groups like (?<name>...)
Capture groups
Numbered groups: shown per match under “Groups”.
Named groups detected: None
#1 @ index 0
length 5
Match
Hello
#2 @ index 6
length 5
Match
world
#3 @ index 13
length 5
Match
Regex
#4 @ index 19
length 6
Match
tester
#5 @ index 26
length 7
Match
example
#6 @ index 35
length 5
Match
hello
#7 @ index 41
length 5
Match
WORLD
#8 @ index 48
length 5
Match
Email
#9 @ index 55
length 4
Match
test
#10 @ index 60
length 7
Match
example
#11 @ index 68
length 3
Match
com
PCRE vs JavaScript regex notes
- JS supports named groups (?<name>...) and backrefs \k<name> (modern engines), but PCRE has broader features.
- Lookbehind (?<=...) is supported in modern JS, but older browsers may not.
- JS uses flags like g i m s u y; PCRE has modifiers like /i /m /s and many extras.
- Some PCRE features don’t exist in JS (e.g. recursion (?R), atomic groups (?>...) in many environments, some conditionals, etc.).
- If you’re pasting patterns from PCRE tools, you may need to remove delimiter slashes and adjust escapes.