Runs locally
$ devdesk regex--local
Text & regex

JavaScript regex tester with matches and capture groups

Test JavaScript regex patterns with positions, capture groups and highlighting. A bounded worker keeps matching separate, with flag and escaping examples.

Loading local tool…

How to use

Enter a pattern without / delimiters. Matching runs in a separate worker and is stopped on timeout. Up to 500 matches are displayed.

Your input stays yours

Step by step

  1. Enter the pattern itself without enclosing / delimiters.
  2. Set flags, enter test text and choose Run.
  3. Inspect the match list and highlights, then rerun after changing the pattern.

Extract an order number

Pattern: order-(\d+)
Flags: g
Text: order-104 and order-205

Enter each line’s value in its corresponding field. Matches should be order-104 and order-205, with capture groups 104 and 205.

Frequently asked questions

Why is there only one match?

Use g to find multiple matches. Without g or y, this tester returns the first match only. Also check whether the pattern restricts where a match may occur.

Why does a copied JavaScript string fail?

String literals add an escaping layer. Enter regex text such as \d+ here; the same pattern in a JavaScript string is commonly written "\\d+".

What do timeout and truncation mean?

The worker stops after 1.5 seconds and displays up to 500 matches. Limits are 10,000 UTF-16 code units for the pattern and 100,000 for test text. Reduce the sample to debug. This uses JavaScript, which can differ from dialects such as PCRE.