How to use: Regex tester
- Type the pattern and flags (g, i, m, s, u, y, d).
- Paste the test text.
- Review the matches and captured groups.
What it accepts and what you get
- Input
- A JavaScript pattern and text up to 200,000 characters.
- Output
- A list of matches with positions and groups.
- Where your data is processed
- Your data is processed in your browser and is not sent to our servers.
Limitations and notes
- It uses JavaScript regular-expression syntax.
- It runs in a separate worker with a 1.5 s limit so a catastrophic pattern cannot freeze the page.
Frequently asked questions
Which regular-expression syntax does it use?
JavaScript's. You see each match with its position and groups.
What if my pattern is very slow?
It runs in a separate process with a 1.5-second limit, so a catastrophic pattern does not freeze the page.
When to use it
- When you want to see what a regular expression captures before putting it in your code.
- To debug why a pattern does not find what you expect.
Examples
- Pull out a postcode
- Try \b\d{5}\b with the g flag on a text with addresses and you will see every match with its position.
- Capture groups
- Use parentheses in the pattern and check what each group captured in each match.
Common mistakes
- Forgetting the g flag: without it only the first match appears.
- Assuming another syntax: it uses JavaScript's, which differs from other languages.
- Testing patterns with catastrophic backtracking: it is cut off at 1.5 s so the page does not freeze.

