Regex Tester

Test a regular expression against any string with live match highlighting and capture groups. Starts with an example.

Share this tool
X LinkedIn WhatsApp Email
Embed this tool on your website

Free to embed on any site. The snippet keeps an optional credit link (marked nofollow) — appreciated, never required.

Reading the results

Every match is highlighted in the test string and listed below. If your pattern has parentheses, each match also shows its capture groups — the sub-strings the groups extracted. Add the g flag to find every match rather than just the first.

Frequently asked questions

What is a regular expression?

A regular expression (regex) is a pattern used to match text — finding, validating or extracting parts of a string. They power search-and-replace, form validation and data parsing.

How do I use this tester?

Type a pattern and flags, then a test string. Matches are highlighted live and listed below with any capture groups. It starts pre-loaded with a working example so you can see how it behaves.

What do the flags mean?

Common flags: g (global — find all matches), i (case-insensitive), m (multiline ^ and $), s (dot matches newlines). This tester uses JavaScript regex syntax.

What are capture groups?

Parentheses in a pattern create capture groups that extract sub-parts of a match. For example, (\w+)@(\w+) captures the user and domain separately.