Tools

Regex tester

Type a pattern and a text - matches highlight as you type, and below you see every group and the replace result.

Pattern
g
Matches
Details
Replace

Everything happens in your browser - nothing you type here is sent to any server.

How it works

How to use the tester

Type the pattern without slashes and tick the flags beside it - “g” finds all matches, not just the first. The tester uses the JavaScript engine, the same as in browsers and Node.js. In the replacement you can refer to groups: $1, $2, or $<name> for named groups.

Patterns check the format, not validity

Patterns for phones, postcodes or tax IDs check the shape of the text, not whether it's real - a tax ID also has a check digit a regular expression can't compute. In form validation, treat them as a first filter.

Frequently asked questions

Will this regex work in PHP or Python?

The basics, yes, but engines differ - e.g. named groups in Python are written (?P<name>…). The tester shows how JavaScript behaves.

What is catastrophic backtracking?

Patterns like (a+)+ can take exponentially long on some texts and freeze a page or a server. The tester stops such a pattern after a second and a half.

Is my text sent anywhere?

No, everything happens in your browser.

Let's talk about your project

Briefly describe what you need and I'll reply as soon as I can. Rather talk right away? Pick a time for a short online call.