MakeMyTxt

Regex Tester

Build a JavaScript regular expression and see live matches, capture groups, and replacements against your sample text.

//gi
Flags

2 matches found

Ping [email protected] or [email protected] for help. We reply within 24 hours.

Match details

How to use: build and test a regular expression with MakeMyTxt

Write a JavaScript regular expression, pick the flags you need, and see every match, capture group, and optional replacement live.

  1. 1

    Open the Regex Tester

    Go to makemytxt.com/regex-tester. A starter pattern for email-looking strings is pre-loaded so you can see matches immediately.

  2. 2

    Edit the pattern

    Type your regex between the slashes. The tester uses the same engine as JavaScript (V8) — anchors, character classes, lookarounds, and named groups all work.

  3. 3

    Toggle flags and test your sample

    Use the checkboxes to flip g (global), i (case insensitive), m (multiline), s (dotAll), u (unicode), and y (sticky). Paste your sample text below; matches highlight as you type.

  4. 4

    Review match details or try a replacement

    Expand any match to see its start index, length, and capture groups. Enable "Replace matches" to preview a substitution using $1, $2, or $<name> references.

Frequently asked questions

What regex flavor does this tool use?
It uses the native JavaScript RegExp engine (ECMAScript 2023). That is the same engine Node.js, Chrome, and every modern browser runs, so patterns you test here will behave identically in your own JavaScript or TypeScript code.
Can I use named capture groups and lookbehind?
Yes. (?<name>…) for named groups and (?<=…) for lookbehind are both supported. Named groups show up under the match details with angle-bracket labels. You can reference named groups in replacements with $<name>.
Why does my pattern match infinitely?
If your pattern matches the empty string (for example /a*/g on an empty input), the engine would otherwise loop forever. The tester advances past zero-length matches and caps the result list at 10,000 matches — if you hit that cap your pattern probably needs a + instead of a *.
Is my sample text sent to a server?
No. The regex, the flags, and the sample all stay in your browser. This matters when the sample contains production logs, user identifiers, or anything else you should not paste into a shared third-party service.

Related tools