Regex Tester
Test regular expressions with flags, matches, and groups.
Use Regex Tester
Matches: 5
sample @ 0
text @ 7
123 @ 12
another @ 16
line @ 24
Introduction
Test regular expression patterns and flags, inspect matches, and review captured groups. Adjust a pattern against sample text and copy the resulting matches.
How it works
Enter a pattern and flags such as g, i, or m.
View matches with their indexes and captured groups.
Uses the browser’s JavaScript regex syntax, rather than PCRE. Enter the pattern without delimiter slashes. With g it lists all matches; without g it shows the first. For example, [0-9]+ on ID 42 and 7 returns 42 and 7 with g, or only 42 without g. Avoid expensive patterns on large text: they run on the page thread.
Example
Refine a regular expression for matching email addresses or identifiers using sample text.
FAQs
Does it show captured groups?
Yes. Captured groups are listed when present.
Are flags supported?
Yes. Standard JavaScript regular expression flags are supported.
Does it detect invalid patterns?
Yes. Invalid patterns produce a syntax error.