Developer tool

Regex Tester

Try a JavaScript regular expression against sample text and inspect the matches before adding it to your code.

← Back to all tools

This tool runs in your browser. Do not treat generated output as a substitute for reviewing it in your target platform.

How to use Regex Tester

  1. Enter a pattern without surrounding slash delimiters.
  2. Choose supported JavaScript flags such as g, i, m, s and u.
  3. Paste sample text and run the test.
  4. Review each match, its index and captured groups.
  5. Try boundary cases and confirm behavior in the language or runtime where the pattern will be used.

What to know

Regular expressions describe text patterns. This tester uses the browser's JavaScript RegExp engine, so its behavior follows JavaScript syntax rather than every regex flavor used by other languages. Test representative examples, including edge cases.

Frequently asked questions

Why does a regex work here but not in Python or PHP?

Regex syntax and features differ between engines. This tool uses JavaScript RegExp; verify the pattern in your target language.

What does the global flag do?

The g flag finds multiple matches rather than stopping after the first match.

Is my test text uploaded?

The matching runs locally in your browser. Standard site analytics may still record page usage, but the sample text is not submitted by this tool.

Privacy Policy · Terms of Use