Regex Tester

Test regular expressions in real time against your text. See matches highlighted live with match groups.

What is a Regex Tester?

A Regex Tester applies a regular expression and flags to sample text. This tool highlights matches, lists their positions and capture groups, counts the results and reports invalid expressions.

The Regex Tester applies a regular expression and flags to your sample text, then highlights matches and lists positions and capture groups. It reports invalid patterns and counts results. It is for developers and advanced users checking patterns before adding them to code.

How to use the Regex Tester

Start with a small sample that contains both text you want to match and text you want to reject.

What do regular expression flags do?

Flags change how a pattern is applied. The g flag finds every match, while i makes matching case-insensitive.

For example, \b\w+@\w+\.\w+\b with gi finds simple email-shaped strings in the sample. It is not a complete email validation standard. Test edge cases and avoid assuming one short pattern covers every valid address.

Regex Tester: questions and answers

Why does my expression show an error?

The pattern or flags may be invalid for JavaScript's RegExp engine. Check unmatched brackets, escaping and supported flags. Correct the expression and the tool will try it again as the inputs change.

What is a capture group?

Parentheses in a pattern can capture part of a match for separate inspection. The Matches panel lists those captured values where present. They are useful when you need a domain, number or other portion rather than the whole match.

Does a match prove my data is valid?

No. A regular expression checks the pattern you wrote, not the wider business meaning of the value. Use representative valid and invalid samples, and add appropriate validation in the application that will use the pattern.

Does the Regex Tester use credits?

Pattern matching, highlighting and group results have no per-run credit charge. They run in your browser using JavaScript. No code is sent for server-side execution or stored by this component.

What this tool does

Regex Tester runs in your browser and has no per-run credit charge. Published by Digital Bridge in Gorey, Co. Wexford.

Related Dev & Web tools

See all tools