Developer & Text Tools

Regex Tester

Test JavaScript regular expressions live: every match highlighted, capture and named groups in a table, a replace preview with $1 and $<name>, and split. Runs safely in a worker, so a runaway pattern cannot freeze the page.
Runs in your browserNothing is uploaded

Pattern

Library:

Test text

Highlighted matches

Contact zoe.smith+news@example.com or visit https://muhammadlab.com/tools. Released 2025-03-14, patched 2025-11-02. Server 192.168.1.20 replied. Brand colours: #17605F and #f0b35b. Call 0412 345 678 or +61 412-345-678. This is is a repeated word test.

Matches

Matches

0

Groups

0

Named

0

#MatchIndex

How to use this tool

  1. 1Type a pattern (without slashes) and toggle the flags.
  2. 2Paste the text to test, or start from the pattern library.
  3. 3Read the highlighted matches and the groups table.
  4. 4Switch to Replace or Split to preview the result, then copy it.

Frequently asked questions

JavaScript (ECMAScript), exactly as your browser runs it, including named groups, lookbehind, the u and s flags and \p{…} Unicode classes. Most patterns also work in Python, Java and PCRE, but check flavour-specific features.

a* can match zero characters, so it matches the empty string at every position where there is no "a". The tester shows these as empty matches and moves on, instead of looping forever.

Matching runs in a background worker with a 1.5 second limit. Patterns with catastrophic backtracking, such as (a+)+$, are stopped with a warning and the page stays responsive.

Use $1 to $9 for numbered groups, $<name> for named groups, $& for the whole match and $$ for a literal dollar sign.

No. Everything runs in your browser with JavaScript. The text you paste is not uploaded, logged or stored by MuhammadLab.