Regex Tester

Test regular expressions, preview matches, split text, or run replacements locally.

Runs locally in your browser. No account required.

Practical usage guide

What this tool does

Regex Tester uses the JavaScript RegExp engine provided by your browser. It can list and highlight matches, replace text with capture-group references, or split input into a JSON array. This makes it useful for quick browser-compatible pattern experiments.

Regular-expression syntax varies across ecosystems. A pattern written for PCRE, .NET, Java, or Python may use constructs or flags that JavaScript does not support, so test with representative input from the real target environment.

Quick start

Enter the smallest useful pattern

Start with a literal or one group, then add boundaries, quantifiers, and alternatives incrementally.

Choose JavaScript flags

Common flags include i for case-insensitive, m for multiline anchors, s for dot-all, and u or v for Unicode behavior.

Select match, replace, or split

Use Matches to inspect indexes and groups, Replace to test $1 or named references, and Split to preview tokenization.

Common use cases

Prototype a validation rule

Test a bounded pattern against valid, invalid, empty, and edge-case samples before placing it in a form.

Extract values from logs

Capture IDs, dates, levels, or fields from a representative log fragment without uploading the text.

Preview a text rewrite

Use capture groups and replacement references to confirm a bulk rename or cleanup rule.

Limitations and important notes

Matching is global in this tool

The engine adds the g flag when it is omitted so all matches can be displayed. Replace and split therefore also operate globally.

Match display is capped at 500

The Matches view stops collecting after 500 results and marks the count with a plus sign. Narrow the pattern for detailed inspection.

Pathological patterns can freeze a tab

Nested ambiguous quantifiers may cause catastrophic backtracking. Avoid testing untrusted patterns against very long text in the main browser thread.

Examples

Find emails

Highlight email-like strings in text.

Frequently asked questions

Are regex patterns sent to a server?

No. The pattern is compiled and executed in your browser.

Which regex flavor is used?

This tool uses JavaScript regular expressions, so supported syntax follows the browser's RegExp implementation.

Related tools