Skip to content

RegEx Tester

Try a search pattern (regular expression) on your own text and see every match highlighted.

  • Free, no account
  • Nothing uploaded
  • 13 tools
Matches in the text
order A-1042 placed 2026-03-14, shipped 2026-03-17
order A-1043 placed 2026-03-15, cancelled
invoice due 2026-04-13
waiting for a patternLimit 2 s per run · no request made

Nothing you paste is uploaded. The server sends connect-src 'self', so your browser blocks this page from contacting any other host. Check it yourself

Test JavaScript regular expressions with live highlighting, groups and named groups. Patterns run in a Web Worker and are stopped after 2 seconds, so a slow one cannot freeze the page.

How this tester runs your pattern

The pattern is compiled by the JavaScript engine of your browser and run against the test text in a Web Worker. Matches are highlighted and listed with their position and capture groups. If the worker has not answered after 2 seconds it is terminated and you are told so.

Catastrophic backtracking

The "Slow pattern" button loads this:

pattern  ^(a+)+$
text     aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa!

The text almost matches, then fails at !. Before giving up, the engine tries every way of dividing the run of a between the inner and the outer +, which doubles with each extra character. On a server, a pattern like this applied to user input is a denial-of-service hole (ReDoS). The fix is to make the pattern unambiguous: ^a+$ matches the same strings in linear time.

Flags

  • g finds every match instead of the first. i ignores case.
  • m makes ^ and $ match at line breaks. s lets . match a line break.
  • u treats the text as code points (needed for \p{L} and for emoji). y matches only at the current position.

Patterns for PCRE, Python, Go or Java can differ in syntax. For those flavours, and for a step-by-step debugger, use regex101.

Questions

Short answers to what people ask most.

Which regex flavour does this tester use?

The JavaScript engine of your browser (ECMAScript). Features differ in other languages: PCRE, Python, Java, Go and .NET each have their own syntax for things like possessive quantifiers, inline flags and lookbehind. For those flavours and for step-by-step debugging, regex101.com is the reference tool.

What happens with a pattern that never finishes?

The pattern runs in a Web Worker, separate from the page. If it has not answered after 2 seconds the worker is terminated, the page stays usable and you get a message. Press "Slow pattern" to see it happen.

What is catastrophic backtracking?

When a pattern has nested or overlapping quantifiers, such as (a+)+$ or (\w+\s?)+$, the engine may try an exponential number of ways to split the text before giving up. On user-supplied input this is a denial-of-service risk known as ReDoS. Rewrite the pattern so each character can be matched in only one way.

Why do I get only one match?

Without the g (global) flag a JavaScript regex stops at the first match. Turn g on to find all of them.