Regex Tester

Test regular expressions against sample text with highlighted matches, capture groups, and a syntax reference.

//g

Enter a pattern to inspect matches.

Flags
0 characters
0 matches

Preview

Matched text is highlighted
Your text preview will appear here.

Matches

Index starts at 0

Enter a pattern and test text to see the matches here.

Regular expression tester

Build a JavaScript regular expression and see its matches, capture groups, and replacement output against sample text.

Results update as you edit. Matching runs in your browser. The g flag finds every match, i ignores case, m changes line anchors, s lets a dot match line breaks, u enables Unicode matching, and y requires a match at the current position.

When to use it

Use it to inspect a pattern against sample input before using it in JavaScript.