Regex Tester

The interactive tool loads here. JavaScript is required to use its controls; the instructions below are available without it.

Test a JavaScript regular expression against sample text and inspect the matches. Use it to check a pattern before using it in a search or validation workflow.

How to use this tool

  1. Enter the expression and supported flags.
  2. Paste a small representative sample; matches update as you edit.
  3. Check matched text and error messages, including examples that should not match.

How to interpret the result

Regular-expression engines differ across languages. A JavaScript result does not establish compatibility with Python, PCRE or a database. Matching runs locally in a background worker after a short typing pause. Patterns that exceed one second of execution are stopped. Use up to 2,000 pattern characters and 100,000 test-text characters; results are capped at 500 matches and a bounded amount of captured text.

Frequently asked questions

Should I paste the surrounding slashes?

Enter the pattern in the pattern field and its flags separately, following the examples shown in the tool.