Skip to main content

Home Tools Regex Tester

Regex Tester

Test JavaScript regular expressions against text in a cancellable browser worker. Inspect matches and capture groups with bounded execution and output.

Regex tester
Enter pattern and test string above
Common flags: g global · i case-insensitive · m multiline · s dot-all

Regex Tester: Pattern and Flags

How to use this tool

Enter a JavaScript regular-expression pattern, choose flags, and provide sample text. Review matches and captured groups against both expected and edge-case inputs.

Limits and safe use

This page tests JavaScript regular-expression behavior, which can differ from other regex engines. Patterns run in a cancellable local worker with a 350 ms execution limit. The tool accepts up to 1,000,000 test characters and 10,000 pattern characters, and displays up to 1,000 matches. Slow expressions are stopped without blocking the page.

Example: find and capture numbers

Use pattern (\d+), flags g, and text A12 B7. It finds 12 at index 1 and 7 at index 5; each match's first capture group contains those digits.

Enter the pattern without JavaScript literal delimiters: use \d+, not /\d+/g, and put flags in their own field. Offsets use JavaScript string indexes. Check MDN's RegExp reference for supported syntax; features can depend on your browser.

Tool notes by DummyDetails. Reviewed . Report a correction.

More Free Tools

Most tool inputs are processed in this page. The site also uses analytics and third-party assets; see the Privacy Policy.