Regex tester

Type your pattern, paste your text, and see the matches instantly. Everything runs on your browser’s JavaScript engine: the same one behind RegExp, match, and replace on the web and in Node.js. We explain each part of the pattern, measure the time, and “Debug” walks through the engine’s real backtracking step by step. If your pattern comes from PCRE, Python, or Go, the compatibility check shows which constructs change when you move it to JavaScript. We also generate the code in six languages and protect the page from catastrophic backtracking.

JavaScript engine

This tester always runs the browser’s JavaScript engine. Pick a language to see which constructs of your pattern change when you take it there; it does not change the engine that runs.

This tester runs the JavaScript engine (the RegExp of the browser and of Node.js). The language you pick above is only for comparing differences: it does not change the engine that runs.

Shortcuts: Alt + P pattern, Alt + T text, Alt + R replacement.

Type a pattern to see the matches, the groups, and the explanation. You can also start with an example or with a pattern from the library.

Saved tests

Write texts that should match the pattern and others that should not. Each test tells you whether it holds. They are saved only on this device.

There are no tests yet.

Code for your project

Generates a short program with your pattern, the flags, and the test text. It changes with the mode (matches, replace, or split).

Pattern explanation

Type a pattern and you will see here what each part does.

Common patterns

Pick one to load it with a sample text. They check the format, not that the data exists.

Syntax cheat sheet

Tap an item to insert it into the pattern.

Step by step

How to use it

  1. Type your regular expression in the “Pattern” field and tick the flags you need: g for all matches, i to ignore case.
  2. Paste the test text. Matches are highlighted live, and the table shows the position and value of each group, numbered or named.
  3. Switch to “Replace” to see the result with $1 or $<name>, or to “Split” to cut the text with the pattern.
  4. If your pattern comes from PHP, Python, or Go, pick that language in “Differences when taking the pattern to another language” to see which constructs change and convert it to JavaScript. Save “should match” and “should not match” tests.
  5. Open “Debug” to walk through the engine’s backtracking step by step, press “Measure” to see the time, and use “Code for your project” to copy the program in JavaScript, Python, PHP, Go, Java, or C#.
FAQ

Frequently asked questions

Which regular expression engine does it use?

The JavaScript engine in your browser (ECMAScript): the same one behind RegExp, match, and replace on the web and in Node.js. Everything is calculated on your device. The “Differences when taking the pattern to another language” section only compares how the pattern would change in PHP/PCRE, Python, or Go; it does not run those engines, so confirm the final result in the language where you will use it.

Does it have a step-by-step debugger for the engine?

Yes: “Debug” mode replays the JavaScript engine’s backtracking attempt by attempt and marks the steps that fail. It instruments literals, classes, quantifiers, groups, alternations, anchors, references, lookarounds (lookahead and lookbehind), Unicode properties such as \p{L} with the u or v flag, and inline modifiers such as (?i:…). To avoid showing false steps, it compares its result with the real engine’s; if the pattern uses something it cannot instrument, the panel explains it and still gives you the list of matches and groups. “Step by step” also walks through each match with its position and groups, and “Measure” gives the average search time.

What is catastrophic backtracking and how does the tool protect me?

Some patterns, such as (a+)+$, can take an enormous amount of time on certain texts because the engine tries too many combinations. We run the pattern in a separate process with a maximum of 1.5 seconds: if it goes over, we stop it and let you know, and the page keeps responding.

Why does \w not match accented letters?

\w is equivalent to [A-Za-z0-9_], so it leaves out accented letters. To match letters from any language, use \p{L} with the u flag, or a set such as [a-zA-ZÀ-ÿ]. There is a ready-made example in the pattern library.

Do the email, phone, or date patterns check that the data is real?

No. They only check the format: for example, that an email has a name, an @, and a domain, without confirming the address exists. They are useful for finding or filtering data in a text, not for validating identities.

Is my text or pattern sent to any server?

No, everything is calculated in your browser. The share link stores the pattern, the flags, and the text in the part of the address after the #, which the browser does not send to any server. Even so, anyone who receives the link will see all of that content: do not include personal or sensitive data.

Most used flags

  • g (global): finds all the matches instead of stopping at the first one.
  • i: ignores the difference between uppercase and lowercase.
  • m: makes ^ and $ apply to each line of the text.
  • u: enables \p{L} and the correct handling of emoji and characters outside the basic alphabet.

Groups and replacement

Parentheses capture a part of the match. With (\d{2})/(\d{2})/(\d{4}) on 09/29/2026 you get the groups 09, 29, and 2026. In the replacement you can reorder them: $3-$1-$2 gives 2026-09-29.

How to avoid catastrophic backtracking

Be wary of nested quantifiers such as (a+)+ or (.*)*. It is usually enough to remove the inner repetition, make the groups more specific, or anchor the pattern with ^ and $. If a pattern goes over the time limit, the tool stops it and tells you.

What the debugger instruments

“Debug” mode walks through the real backtracking of the JavaScript engine and covers literals, character classes, quantifiers, groups, alternations, anchors, backreferences, lookarounds (lookahead and lookbehind), Unicode properties such as \p{L} with the u or v flag, and inline modifiers such as (?i:…). If the pattern uses something the tracer cannot reproduce exactly, the panel explains it and still shows the real engine’s list of matches and groups, instead of making up steps.

The engine is JavaScript

This tester runs your browser’s JavaScript engine, the same one behind RegExp. The “Differences when taking the pattern to another language” section compares your pattern with PHP/PCRE, Python, and Go and shows which constructs change: for example, that Go does not support lookarounds or backreferences, that Python writes named groups as (?P<name>…), or that JavaScript has no atomic groups (?>…). Nothing runs in those other engines: for the final result, test the pattern in the language where you will use it.

A tip for validating data

A regular expression checks the shape of a piece of data, not whether it exists. For an email or a phone number, use it as a first filter and confirm the data in another way.

Updated on October 2, 2026