inyourbrowser.com

Regex tester

Regex tester is a developer tool that runs JavaScript regular expressions against test input. It highlights matches inline, supports all standard flags, and offers match, replace, and split modes with named capture-group output. The tool runs in your browser.

//
Test string
0 matches
Enter a pattern and test string above

MODE

Runs entirely in your browser

How to test a regular expression

  1. Enter your regular expression in the pattern field at the top.
  2. Toggle flags using the buttons: case-insensitive (i), global (g), multiline (m).
  3. Paste or type the test string in the input area below.
  4. Matches are highlighted in real time, click a match to see the captured groups.

Common uses

  • Testing a regex pattern against sample data before using it in production code, use text diff to compare the original and transformed text after a replace operation
  • Building and debugging regular expressions interactively with instant feedback
  • Extracting captured group values to verify that named or numbered groups work correctly. The JSON formatter is useful when the captured output is JSON

Technical specification

  • Algorithm or formula: JavaScript (ECMAScript) RegExp engine, executed inside a dedicated Web Worker with a 2-second wall-clock timeout to abort runaway catastrophic backtracking.
  • Browser API or library: Native RegExp compiled in the worker; Worker and MessageChannel APIs for sandboxing; main thread renders inline match highlights via DOM ranges.
  • Input limits: Test input up to 5,000 characters. Pattern up to ~1,000 characters. Worker timeout 2 seconds.
  • Output: Inline match highlights, list of matches with numbered and named capture groups, replace output, and split-result array.
  • Known limitations: ECMAScript flavor only; PCRE, Python, and .NET features (e.g., conditional patterns, recursion) are not supported. Patterns that exceed the 2-second timeout return an error.

Frequently asked questions

Is my data sent to a server?
No. Regex matching runs entirely in your browser using JavaScript's built-in RegExp engine.
What regex flavour does the tool use?
The tool uses the JavaScript (ECMAScript) regex engine, which supports most standard features. Some flavours (PCRE, Python, .NET) have minor syntax differences.
Can I test regexes with named capture groups?
Yes. Named capture groups are supported and shown in the match breakdown panel.
Why does my regex behave unexpectedly with the g flag?
The global flag can cause unexpected behaviour with stateful regex patterns in JavaScript. Test without the g flag first to confirm your pattern is correct.

Reviewed and tested May 26, 2026.