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.
Sample text
Matches are highlighted in the Match results panel as you type.
Match results
0 matches
Pattern explanation
A deterministic reference for common tokens in your pattern. This is not AI.
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.
- Choose a template above or enter a pattern without the surrounding slash characters.
- Enable the flags your application uses.
- Paste sample text or switch to line-by-line mode for a list of values.
- 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.