JavaScript Regex Tester — Matches & Capture Groups

Test JavaScript regular expressions against text. Inspect match positions, numbered and named capture groups, with worker isolation and a timeout.

◈ Processed in your browser · inputs are not saved

JavaScript regex syntax. Execution stops after about one second.

Inputs stay in page memory. Only your theme preference is saved.

How it works

Enter a pattern without surrounding slash delimiters, choose flags such as g or i, and run it against test text. Without g, only the first match is reported. Numbered groups and named groups are included in the output. Match positions use JavaScript UTF-16 indices. Highlighting shows the corresponding text; an empty match is marked with the ∅ symbol.

Limits and behavior

Patterns execute in a dedicated worker that is terminated after about one second, so expensive backtracking does not run on the page thread. Results are capped at 2,000 matches and a bounded response size. Long captures and match text can be shortened. A cap message indicates incomplete output. Unsupported or duplicate flags and invalid syntax produce native engine errors.

Example

The pattern (?<word>[A-Za-z]+) with g finds words in Hello DevKit! and names each capture word. Test text is limited to 200,000 characters and patterns to 2,000. This is JavaScript syntax, not PCRE.

Assumptions and limitations

Start with Load example to see the expected input shape. Replace the example with your own text and choose the relevant operation. Editing an input invalidates the previous output so an old result cannot be copied as if it were current. Copy and download buttons become available after a successful run. Clear removes the visible inputs and output from the page. Limits keep small development tasks responsive; use a local editor or dedicated command-line utility for very large files. A successful transformation does not validate your application logic or make untrusted data safe to execute.

Sources

MDN Web Docs

Frequently asked questions

Are pasted inputs saved or uploaded?

No. These tools process input in page memory. Only the selected display theme is stored. Reloading or changing language resets inputs. Your browser may independently offer form restoration.

Can I use the tools without signing in?

Yes. No account, API key or installation is required. JavaScript must be enabled. Each tool provides example input and a local output download.

Why did my previous output disappear?

Editing an input marks the old result as stale. Run the tool again before copying or downloading. This avoids mixing an earlier result with changed input.