← Back to all browser tools
DEVELOPER TOOL / 63

Test a regex.
Catch the edge case.

Try a JavaScript regular expression against sample text, inspect capture groups, and preview a replacement without sending the text anywhere.

How do I test a regular expression? Paste a pattern and test text to see matches and groups highlighted live.

Regular expression tester

This tester uses the JavaScript RegExp engine. Patterns and test text stay in your browser; a maximum input size keeps accidental runaway patterns manageable.

How to test a regular expression

  1. Enter your pattern — plus the sample text to run against it.
  2. Read the highlights — matches, capture groups, and indexes are shown live.
  3. Try the replacement — preview substitutions before putting the regex into code.

When this saves you

Good to know

This uses JavaScript regex flavor — most patterns port to other languages, but not all. Always test the boring edge cases (empty string, unicode, trailing newline), and keep patterns specific: vague ones like .* repeated can cause catastrophic backtracking and freeze a tab. Related: SQL formatter for query cleanup.

Advertisement
QUICK ANSWERS
Which regex syntax is supported?

This page uses the regular expression syntax built into your browser's JavaScript engine, including flags such as g, i, m, s, u, and y.

Why are there no matches?

Check the pattern, flags, and whether you need a global g flag for repeated matches.