Explore EN
Open navigation menu

Regex Tester

Run a regular expression against sample text in your browser and inspect every match locally.

Your data stays in your browser. Nothing is uploaded or saved.

JavaScript syntax; indexes count UTF-16 code units. Ctrl/Cmd + Enter runs the test. Execution stops after 1 second; results are limited to 1,000 matches and input to 1 MiB.

Test JavaScript regular expressions against sample text locally. The tool shows every match and its capture groups without sending your pattern or text to a server.

When to use the Regex Tester

Use it while writing a JavaScript pattern, checking a validation rule or investigating why a pattern matches too much or too little. Enter the pattern without surrounding slashes, choose only the flags you need, and paste representative sample text.

How to read the results

Each result reports the matched text and its position. Numbered and named capture groups are listed with the match so you can verify which part of the pattern captured each value. A valid pattern with no results is different from an invalid pattern: no match is a legitimate outcome, while syntax errors are reported before execution.

Practical example

To find capitalised words, test \b([A-Z][a-z]+)\b with the g flag against Ada wrote code with Linus. The full matches are Ada and Linus, and capture group 1 contains each name.

Limits and edge cases

  • Patterns use the JavaScript regular-expression syntax supported by your browser.
  • Match positions use JavaScript UTF-16 indices, which can differ from visible character counts for some emoji and combined characters.
  • Execution is isolated and stopped after one second. Output is capped at 1,000 matches and input at 1 MiB.
  • Test realistic examples and non-matching input; a successful sample does not prove a pattern is safe or correct for every value.

For adjacent developer tasks, use the JSON Formatter & Validator, Unix Timestamp Converter or UUID & ULID Generator.