^[^\s@]+@[^\s@]+\.[^\s@]+$
Checks a simple email-shaped string for forms and demos. For production account systems, combine it with server-side validation.
Check regex JavaScript patterns against sample text, debug flags, inspect match indexes and review capture groups before using them in browser, Node.js or TypeScript code.
You can enter a raw pattern or paste JavaScript literal syntax such as /hello/gi. Literal flags are combined with the selected options.
Results will appear here.
/hello/gi
Test text:
Hello hello
Result:
2 matches found at indexes 0 and 6
Use these examples as safe starting points, then adjust them for your real input. A regex tester is most useful when you paste realistic sample text instead of only testing the perfect case.
^[^\s@]+@[^\s@]+\.[^\s@]+$
Checks a simple email-shaped string for forms and demos. For production account systems, combine it with server-side validation.
\b\d+(?:\.\d+)?\b
Matches integers and decimal numbers in logs, CSV snippets or pasted text.
"([^"]+)"
Uses a capture group so you can inspect the text inside quotes in the match details.
^[A-Za-z_$][A-Za-z0-9_$]*$
Checks whether a short string follows the common JavaScript variable-name shape.
\d+, or paste a JavaScript regex literal such as /hello/gi.The result displays at most the first 1,000 matches. Testing runs away from the page interface and stops after 1.5 seconds, so an accidental expensive pattern cannot leave the tab permanently frozen.
g — global search, returns every match instead of only the first one.i — ignore case, so hello can match Hello.m — multiline anchors, so ^ and $ work per line.s — dotAll mode, so . can match newline characters.u — Unicode mode, useful for modern text and safer character handling.
You can select flags with the checkboxes or paste a JavaScript literal such as /error|warning/gi. This helps you check regex JavaScript behavior before copying the pattern into code.
( has a matching )..*.m flag and test with realistic multi-line text.Regex Tester is useful for checking JavaScript validation patterns, matching IDs in logs, extracting text fragments and debugging capture groups before shipping code. The result includes each match and its zero-based index so you can verify where the expression matched.
Use it for quick browser, Node.js and TypeScript regex checks when you need to confirm exact JavaScript behavior. Paste a raw pattern or a literal like /[A-Z]+/gi, add sample text and verify the output before changing production code.
A regex tester lets you run a regular expression against sample text before adding it to your code. This tester uses the browser's native JavaScript RegExp engine, so its syntax and behavior match modern browser, Node.js and TypeScript projects.
Flags change how the same pattern behaves. Use g to return every match, i to ignore letter case, m to make line anchors work per line, s to let a dot match newline characters and u for Unicode-aware parsing.
For example, /hello/gi finds both “Hello” and “hello”. If a pattern is invalid, the tool shows the JavaScript error so you can correct it. All testing happens locally in your browser.
What is a regex tester?
It runs a regular expression against sample text and reports the matches, positions and capture groups so you can debug a pattern before using it in code.
Is this regex tester compatible with JavaScript?
Yes. It is designed around JavaScript RegExp behavior, which makes it useful for browser code, Node.js and TypeScript projects.
What regex flags are supported?
The tool supports global (g), case-insensitive (i), multiline (m), dotAll (s) and Unicode (u). You can combine them or paste them in JavaScript literal syntax.
If you are not sure how to test a JavaScript pattern safely, read the step-by-step guide: How to test JavaScript regex patterns.