← back to flaviocopes.com

Regex tester & explainer

← All tools

Type a pattern, pick flags, paste a test string, and see matches highlighted instantly — plus a plain-English walkthrough of what each piece of the regex does.

~~~

Common patterns

~~~

Pattern

Flags

Active flags:

Test string

~~~

Validity

Enter a pattern to test it against the string above.

Valid pattern with flags .

Invalid pattern —

Highlighted matches

Match list

#MatchIndexGroups
~~~

Pattern breakdown

Plain-English notes for common constructs. This is a helper, not a full regex parser — complex or nested patterns may get approximate rows.

Enter a pattern to see a breakdown.
No tokens to explain.
TokenMeaning

Everything runs in your browser — your pattern and test string never leave this page. Matching uses the JavaScript RegExp engine, which differs from PCRE in a few edge cases (lookbehind limits, Unicode properties, etc.).

~~~

About this tool

A regex tester lets you iterate on a regular expression against sample text before you ship it in code, a search-and-replace, or a validation rule. This one highlights every match, lists capture groups, and explains each token in plain English so you can sanity-check what you wrote.

Under the hood it uses the same RegExp constructor your browser and Node.js use — not PCRE. That means features like named groups and lookbehind work in modern engines, but syntax and edge cases can differ from Perl, Python, or grep.

Flagsg finds all matches; i ignores case;m makes ^ and$ match line boundaries; s lets. span newlines; u enables full Unicode mode; y sticky matching starts only atlastIndex.

~~~

Read more