Text

Regular Expression Tester

Test regular expressions live with match highlighting and a breakdown of every capture group.

//

This tool runs entirely in your browser — your data never leaves your device.

What is Regular Expression Tester?

Regular expressions are the most powerful way to describe patterns in text, and also among the hardest things to get right on the first attempt. The effective approach is always iterative: write a pattern, paste in real text, see what it matches, adjust.

This tool highlights matches directly in your test text and lists every result with its position and capture group contents. That makes it immediately obvious where your pattern is too greedy or too narrow.

Several common patterns are included to start from: email, phone number, URL, IP address, date and hex colour. These are exactly the patterns people end up rewriting over and over.

How to use

  • Enter your pattern in the field above; no surrounding slashes needed.
  • Toggle the flags you need — i for case-insensitive is the most commonly used.
  • Paste real text into the box below. Matches highlight instantly.
  • Check the details table for the position and capture groups of each match.

Frequently asked questions

What do the g, i, m and s flags do?

g finds every match rather than stopping at the first. i ignores case. m makes ^ and $ match the start and end of each line instead of the whole string. s makes the dot match newline characters too.

Why does my pattern hang the page?

You may have hit catastrophic backtracking — typically caused by nested quantifiers like (a+)+ against a long non-matching string. The tool caps results at 500 to reduce the risk, but a poorly formed pattern can still be slow.

Which regex dialect is this?

JavaScript, since the tool runs in your browser. Most syntax is shared with Python, PHP and Java, though there are differences — for instance lookbehind support varies on older browsers.