FREE ONLINE DEVELOPER TOOL

Regex Tester

Build, test, and debug regular expressions directly in your browser. Inspect matches, capture groups, and replacement results instantly.

REGULAR EXPRESSION WORKSPACE

Test your pattern

JavaScript RegExp

Enter a pattern without the surrounding slashes. Select flags below.

Flags
Try an example:
Enter the text you want to test

TEST OUTPUT

Match results

Ready
Matches 0
Characters 0
Pattern status —

Highlighted text

Matched text is highlighted below
Your highlighted results will appear here.

Match details

No matches to display yet.

Capture groups

Capture groups will appear here when available.

OPTIONAL

Replacement preview

Supports JavaScript replacement tokens such as $1, $&, and $<name>.

Preview

Your replacement preview will appear here.

Privacy: Your regular expressions and test text are processed locally in your browser. Nothing is uploaded to a server.

HOW IT WORKS

Test regular expressions in your browser

A regular expression (regex) is a pattern used to search, validate, and extract text. This tool lets you enter a pattern, choose flags, and test it against sample text.

Matching results include match positions, captured values, and a replacement preview. Changes can be tested without installing software or sending text to a server.

SUPPORTED FLAGS

Common JavaScript regex flags

  • g — Find all matches instead of stopping at the first.
  • i — Match without case sensitivity.
  • m — Make start and end anchors work across lines.
  • s — Let the dot match line terminators.
  • u — Enable Unicode-aware matching.
  • y — Match only at the current lastIndex position.

FAQ

Frequently asked questions

What is a regular expression?

A regular expression is a sequence of characters that defines a search pattern. It is commonly used to find, validate, and extract text.

Which regex syntax does this tool support?

This tool uses the JavaScript RegExp engine built into your browser. Some syntax supported by other regex engines may not be available.

What are capture groups?

Capture groups are parts of a pattern enclosed in parentheses. They let you extract specific portions of a match. Named capture groups are also supported.

Why does my regular expression show an error?

The pattern may contain invalid syntax, unsupported flags, or unmatched parentheses. Check the error message and review the pattern.

Is my test text uploaded or stored?

No. Matching and replacement are performed locally in your browser. The tool does not upload your test text to a server.

Can I use this tool for Chinese text and emoji?

Yes. The tool supports Unicode text, including Chinese characters and emoji, subject to JavaScript regular expression behavior.