Developer

Regex Tester

Write a pattern and see every match highlighted in the text as you type, with capture groups named and numbered, the replacement result for a substitution, and the match list exportable as JSON or CSV. The engine is JavaScript's, which shares most syntax with Python's re; differences are noted.

Loading the tool…

How it works

01

Write the pattern

With flags g, i, m, s, u, y. Errors in the pattern are shown as you type.

02

Paste the text

Matches are highlighted in place; the side panel lists each match with its groups and position.

03

Replace or export

A replacement string with $1 or $<name> references previews the result; matches export as JSON or CSV.

Formats, limits and the numbers that matter

Python differences

Named groups are (?<name>...) in JavaScript and (?P<name>...) in Python; lookbehind works in both; possessive quantifiers and atomic groups are not in JavaScript.

Unicode

The u flag enables \p{Script=Devanagari} and similar classes, which is how to match Hindi or Arabic script reliably.

Performance

Catastrophic backtracking is detected by a timeout so the tab does not hang; the pattern is flagged.

Common questions

Can I test against many lines?

Yes; multiline mode with the m flag treats each line's start and end as anchors.

Is there a cheat sheet?

The reference panel lists classes, anchors, quantifiers and groups with examples.

Can it pre-annotate entities?

The NER Annotator has a regex box for that; test the pattern here first.