Developer

JavaScript Regex Tester

Validate JavaScript regex syntax, highlight matches, inspect indices and captured groups, and stop runaway execution without freezing the page.

View Developer Tools

Patterns and test text run locally in a disposable browser Web Worker.

This tester uses the browser's JavaScript regular expression engine. Syntax and behaviour may differ from PCRE, Python, PHP, Java, or .NET.

Flags

Highlighted matches

Run the tester to see matches.

Tool Teaze tests JavaScript regular expressions in your browser.

Regex processing runs locally in a disposable Web Worker. Tests that exceed one second are terminated to keep the page responsive.

What this tool does

This tester runs JavaScript regular expressions away from the main UI thread and returns match text, offsets, and captured groups.

How to use it

  • Enter a JavaScript regex pattern and select the required flags.
  • Add test text and run the tester.
  • Review highlighted matches, indices, and capture details.

Example input and output

Input: Pattern \b[A-Z][a-z]+\b with the g flag

Output: Every matching capitalised word with its start and end indices

Common use cases

  • Checking browser-side validation patterns
  • Exploring captured groups
  • Testing global text matching before using code

FAQ

Which regex engine does this use?

It uses the JavaScript RegExp engine provided by your browser, not PCRE, Python, PHP, Java, or .NET.

Can a difficult expression freeze the page?

Execution happens in a Web Worker that is terminated after one second, keeping the main interface responsive.

Can u and v flags be combined?

No. JavaScript defines them as incompatible, and the tester reports that combination as an error.