Developer tools

Regex Tester

Test JavaScript regular expressions in an isolated worker with a timeout and match details.

Make it yours

Common flags: g (all matches), i (ignore case), m (multiline), s (dot matches newline), u (Unicode).

Processed in your browser

Your result

A little input. A useful result.

Adjust the example inputs, then select Test pattern.

A LITTLE KNOW-HOW

About this tool

Inspect how a JavaScript regular expression matches sample text. Patterns execute in a dedicated worker that is stopped after about half a second, keeping pathological patterns away from the page’s main thread. At most 1,000 matches are returned.

How to use it

  1. 1

    Enter a JavaScript pattern without surrounding slash delimiters.

  2. 2

    Choose flags and add sample text; use g to find multiple matches.

  3. 3

    Run the pattern and inspect match positions and capture groups.

Questions, answered

Which regex flavor does this use?

The JavaScript regular-expression implementation provided by your browser. Unsupported flags or syntax produce an error. Match positions are UTF-16 code-unit indexes.

Why was a pattern stopped?

Some patterns take an extremely long time on certain text. The worker is terminated after about 500 milliseconds. Simplify nested repetition or reduce the sample size and try again.