Real-Time Matching
See matches highlighted instantly as you type your pattern. No buttons to click — results update on every keystroke.
Test and debug your regular expressions in real-time. Our free tool provides live match highlighting, group information, and a handy cheatsheet for JavaScript regex.
Real-time regex matching with capture groups, flags, and a cheatsheet — right in your browser. No uploads, no sign-up.
Type your regular expression into the pattern input field. Use the flags checkboxes to toggle g, i, m, s, u, or y modifiers.
Choose the appropriate flags for your search, such as 'g' for global search or 'i' for case-insensitivity.
Enter the text you want to test your expression against in the 'Test String' area. You can paste up to several megabytes of text.
View the highlighted matches in real-time and review the detailed match information, including capture groups, in the results panel.
Real-time matching, detailed group info, and a built-in cheatsheet.
See matches highlighted instantly as you type your pattern. No buttons to click — results update on every keystroke.
Every capture group is displayed alongside the full match, showing the exact text captured by each group in your pattern.
Toggle g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode), and y (sticky) flags independently.
See the index, length, and captured text for each match. Perfect for debugging complex patterns with multiple groups.
All regex processing happens locally in your browser. Your patterns and test data never leave your device.
No registration, no API key, no daily quotas. Free for personal and commercial use, forever.
A regular expression (regex or regexp) is a sequence of characters that defines a search pattern. The concept originated in the 1950s in theoretical computer science and was popularized by Unix tools like grep, sed, and awk. Today, regex is supported by virtually every programming language and text editor, making it one of the most universally useful skills a developer can learn.
At its core, a regex pattern describes what text to match using a combination of literal characters (which match themselves) and metacharacters (which have special meaning). For example, the pattern '\d{3}-\d{4}' matches any text in the format '123-4567' — three digits, a hyphen, and four digits. The power of regex comes from its ability to express complex matching rules concisely.
Quantifiers (*, +, ?, {n,m}) control how many times a pattern element can repeat. By default, quantifiers are greedy — they match as many characters as possible, then backtrack if the overall pattern fails. This can lead to unexpected results: the pattern '<.*>' applied to '' matches the entire string '' because .* greedily consumes everything up to the last >.
Lazy quantifiers (*?, +?, ??, {n,m}?) do the opposite — they match as few characters as possible. The pattern '<.*?>' applied to '' matches just ''. Lazy quantifiers are usually preferred for tasks like extracting HTML tags or matching quoted strings, where you want the smallest possible match.
Nested quantifiers like (a+)+ or (a*)* can cause catastrophic backtracking — the regex engine tries an exponential number of combinations on non-matching input. To avoid this, use more specific patterns, atomic groups (?>...), or possessive quantifiers (a++) when available. If your regex causes the browser to freeze, simplify the pattern by reducing nested quantifiers.
Real-world scenarios where a regex tester saves time.
Test patterns for email, phone, URL, and postal code validation before deploying them in your application.
Extract specific fields from server logs, application logs, or access logs using capture groups.
Develop and test regex-based find-and-replace patterns for code refactoring or data transformation.
Test patterns used for input sanitization and WAF rules against various attack payloads.
A side-by-side comparison of popular regex testing tools.
| Feature | NovaTools | Regex101 | RegExr | VS Code |
|---|---|---|---|---|
| Privacy (no upload) | 100% local | Uploads to server | Uploads to server | Local |
| Price | Free unlimited | Free with ads | Free with ads | Free |
| Real-time matching | ||||
| Capture groups | ||||
| Cheatsheet | Built-in | |||
| All JS flags | g,i,m,s,u,y | |||
| Mobile friendly | Limited | Limited | ||
| Works offline | After page load |
Regex101 and RegExr are excellent tools but upload your test data to their servers. Our tool processes everything locally — your patterns and test strings never leave your browser.
A cheat sheet for JavaScript (ECMAScript) regular expression syntax.
| Symbol / Code | Description | Example |
|---|---|---|
. | Matches any single character except newline (unless 's' flag is set). | a.c → abc, axc |
\d | Matches any digit (0-9). Equivalent to [0-9]. | \d+ → 123 |
\D | Matches any non-digit character. | \D+ → abc |
\w | Matches any word character (letter, digit, underscore). | \w+ → hello_123 |
\W | Matches any non-word character. | \W+ → !@# |
\s | Matches any whitespace (space, tab, newline). | \s+ → ' \n' |
.Matches any single character except newline (unless 's' flag is set).
a.c → abc, axc\dMatches any digit (0-9). Equivalent to [0-9].
\d+ → 123\DMatches any non-digit character.
\D+ → abc\wMatches any word character (letter, digit, underscore).
\w+ → hello_123\WMatches any non-word character.
\W+ → !@#\sMatches any whitespace (space, tab, newline).
\s+ → ' \n'| Symbol / Code | Description | Example |
|---|---|---|
* | Matches 0 or more occurrences. | ab* → a, ab, abbb |
+ | Matches 1 or more occurrences. | ab+ → ab, abbb |
? | Matches 0 or 1 occurrence (optional). | colou?r → color, colour |
{n} | Matches exactly n occurrences. | \d{4} → 2026 |
{n,m} | Matches between n and m occurrences. | \d{2,4} → 12, 123, 1234 |
*Matches 0 or more occurrences.
ab* → a, ab, abbb+Matches 1 or more occurrences.
ab+ → ab, abbb?Matches 0 or 1 occurrence (optional).
colou?r → color, colour{n}Matches exactly n occurrences.
\d{4} → 2026{n,m}Matches between n and m occurrences.
\d{2,4} → 12, 123, 1234| Symbol / Code | Description | Example |
|---|---|---|
^ | Matches start of string (or line with 'm' flag). | ^Hello → Hello at start |
$ | Matches end of string (or line with 'm' flag). | world$ → world at end |
\b | Matches word boundary (between word and non-word char). | \bcat\b → cat (not category) |
(...) | Capturing group. Remembers matched text. | (\d+)-(\d+) → 123-456 |
(?:...) | Non-capturing group. Groups without remembering. | (?:ab)+ → abab |
(?=...) | Positive lookahead. Asserts pattern follows. | \d+(?=px) → 12 in '12px' |
^Matches start of string (or line with 'm' flag).
^Hello → Hello at start$Matches end of string (or line with 'm' flag).
world$ → world at end\bMatches word boundary (between word and non-word char).
\bcat\b → cat (not category)(...)Capturing group. Remembers matched text.
(\d+)-(\d+) → 123-456(?:...)Non-capturing group. Groups without remembering.
(?:ab)+ → abab(?=...)Positive lookahead. Asserts pattern follows.
\d+(?=px) → 12 in '12px'This tool is powered by your browser's own JavaScript engine.
Discover the best free tools for developers that boost productivity without breaking the bank. From code formatters to API testers, these tools will streamline your workflow.
Learn 12 text case styles, when to use camelCase, PascalCase, snake_case, kebab-case and Title Case, and how programming conventions differ by language.
Learn what Base64 is, when to use standard vs URL-safe Base64, and how to encode or decode text locally in your browser without uploading data.