Test regular expressions online

Test regular expressions for JavaScript, TypeScript, Angular, and Node.js. View live matches, capture groups, and flags, or validate up to 1,000 values.

Regex input

Enter a pattern, set flags, then test sample text in the same workspace.

g
Flags

Sample text

Matches are highlighted in the Match results panel as you type.

Processed locally in your browser Limit 50,000 characters. Your input is processed in your browser and is not uploaded or sent to a server. Avoid pasting production secrets, access tokens, private keys, passwords, or sensitive customer data unless you understand the risk.
0 / 50,000 characters

Match results

0 matches

Enter a pattern and sample text to see matches.

Pattern explanation

A deterministic reference for common tokens in your pattern. This is not AI.

Enter a pattern to see token explanations.

What is a regex tester?

A regex tester runs a regular expression against text so you can verify matches, boundaries, capture groups, and flags before using the pattern in code. This tester uses the JavaScript regular expression engine built into your browser.

How to test a regular expression

Need more context on pattern syntax, escaping, and flags? Read the Regex Guide.

  1. Choose a template above or enter a pattern without the surrounding slash characters.
  2. Enable the flags your application uses.
  3. Paste sample text or switch to line-by-line mode for a list of values.
  4. Review highlighted matches, indexes, and capture groups, then test edge cases that should fail.

Common regex flags explained

g finds every match, i ignores letter case, m changes line anchors, s lets dot match line breaks, u enables Unicode-aware behavior, and y performs sticky matching from the current index.

Common regex examples

Use ^\d+$ for digits only, ^[A-Za-z0-9]+$ for basic alphanumeric values, and \s+ to find whitespace. The template library above includes practical starting points for email, URL, IP address, UUID, date, phone, and more.

Regex testing tips

Test valid and invalid values, include empty and unusually long input, anchor validation patterns with ^ and $, and avoid ambiguous nested repetition. Regex syntax and Unicode behavior can vary between programming languages.

Frequently asked questions

Is this regex tester free?

Yes. It is free to use and requires no account.

Does it send my regex or test data to a server?

No. Regex patterns and sample text are processed entirely in your browser and are not sent to a server.

Which regex engine does this use?

It uses your browser's JavaScript RegExp engine.

Why does my regex behave differently in another language?

Regex engines differ in supported syntax, flags, escaping rules, Unicode handling, and advanced features. Test the final pattern in the language and runtime where it will run.

Can I test multiple values at once?

Yes. Switch to Line-by-Line Test and paste up to 1,000 values, one per line.

Does this tool generate regex automatically?

No. It provides editable templates and deterministic token explanations, but it is not an AI regex generator.