Regex Tester & Debugger

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.

Advertisement
Advertisement

Test regex patterns without uploading your data

Real-time regex matching with capture groups, flags, and a cheatsheet — right in your browser. No uploads, no sign-up.

100% private
Real-time matching
Free forever

How to use

  1. 1

    Enter Your Pattern

    Type your regular expression into the pattern input field. Use the flags checkboxes to toggle g, i, m, s, u, or y modifiers.

  2. 2

    Select Flags

    Choose the appropriate flags for your search, such as 'g' for global search or 'i' for case-insensitivity.

  3. 3

    Provide a Test String

    Enter the text you want to test your expression against in the 'Test String' area. You can paste up to several megabytes of text.

  4. 4

    Analyze Results

    View the highlighted matches in real-time and review the detailed match information, including capture groups, in the results panel.

Powerful Regex Testing, Right in Your Browser

Real-time matching, detailed group info, and a built-in cheatsheet.

Real-Time Matching

See matches highlighted instantly as you type your pattern. No buttons to click — results update on every keystroke.

Capture Group Display

Every capture group is displayed alongside the full match, showing the exact text captured by each group in your pattern.

All Flags Supported

Toggle g (global), i (case-insensitive), m (multiline), s (dotall), u (unicode), and y (sticky) flags independently.

Match Details

See the index, length, and captured text for each match. Perfect for debugging complex patterns with multiple groups.

100% Private

All regex processing happens locally in your browser. Your patterns and test data never leave your device.

Free with No Limits

No registration, no API key, no daily quotas. Free for personal and commercial use, forever.

Advertisement

Understanding Regular Expressions

What is a regular expression?

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.

Advertisement

Greedy vs. lazy quantifiers

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.

Advertisement

Common Use Cases

Real-world scenarios where a regex tester saves time.

Input Validation

Test patterns for email, phone, URL, and postal code validation before deploying them in your application.

Log Parsing

Extract specific fields from server logs, application logs, or access logs using capture groups.

Search & Replace

Develop and test regex-based find-and-replace patterns for code refactoring or data transformation.

Security Testing

Test patterns used for input sanitization and WAF rules against various attack payloads.

How does this compare to other regex testers?

A side-by-side comparison of popular regex testing tools.

FeatureNovaToolsRegex101RegExrVS Code
Privacy (no upload)100% localUploads to serverUploads to serverLocal
PriceFree unlimitedFree with adsFree with adsFree
Real-time matching
Capture groups
CheatsheetBuilt-in
All JS flagsg,i,m,s,u,y
Mobile friendlyLimitedLimited
Works offlineAfter 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.

Regular Expression Quick Reference

A cheat sheet for JavaScript (ECMAScript) regular expression syntax.

Character Classes

.

Matches any single character except newline (unless 's' flag is set).

Example:a.c → abc, axc
\d

Matches any digit (0-9). Equivalent to [0-9].

Example:\d+ → 123
\D

Matches any non-digit character.

Example:\D+ → abc
\w

Matches any word character (letter, digit, underscore).

Example:\w+ → hello_123
\W

Matches any non-word character.

Example:\W+ → !@#
\s

Matches any whitespace (space, tab, newline).

Example:\s+ → ' \n'

Quantifiers

*

Matches 0 or more occurrences.

Example:ab* → a, ab, abbb
+

Matches 1 or more occurrences.

Example:ab+ → ab, abbb
?

Matches 0 or 1 occurrence (optional).

Example:colou?r → color, colour
{n}

Matches exactly n occurrences.

Example:\d{4} → 2026
{n,m}

Matches between n and m occurrences.

Example:\d{2,4} → 12, 123, 1234

Anchors & Groups

^

Matches start of string (or line with 'm' flag).

Example:^Hello → Hello at start
$

Matches end of string (or line with 'm' flag).

Example:world$ → world at end
\b

Matches word boundary (between word and non-word char).

Example:\bcat\b → cat (not category)
(...)

Capturing group. Remembers matched text.

Example:(\d+)-(\d+) → 123-456
(?:...)

Non-capturing group. Groups without remembering.

Example:(?:ab)+ → abab
(?=...)

Positive lookahead. Asserts pattern follows.

Example:\d+(?=px) → 12 in '12px'

FAQ

What is a Regular Expression (Regex)?
A regular expression is a sequence of characters that specifies a search pattern. It is a powerful tool used in programming and text editing to find, replace, and validate text based on complex patterns. Regex is supported by virtually every programming language — JavaScript, Python, Java, C#, Go, Rust, and more — as well as by text editors like VS Code, Sublime Text, and Vim. Common use cases include email validation, phone number extraction, log parsing, and search-and-replace operations.
What do the flags (g, i, m, s, u, y) mean?
Flags modify the search behavior. 'g' (global) finds all matches instead of just the first. 'i' (case-insensitive) ignores letter casing. 'm' (multiline) allows start (^) and end ($) anchors to match the start/end of each line, not just the entire string. 's' (dotall) allows the dot (.) to match newline characters. 'u' (unicode) enables full Unicode support, including astral characters. 'y' (sticky) matches only from the lastIndex position. Our tool lets you toggle each flag independently.
Why does my browser freeze with certain patterns?
This happens due to 'catastrophic backtracking,' where a poorly written regex takes an extremely long time to process specific strings. This often occurs with nested quantifiers like `(a+)+` or `(a*)*` applied to strings that don't match. The regex engine tries an exponential number of combinations before giving up. To avoid this, make your pattern more specific, use atomic groups if supported, or use possessive quantifiers. If your browser freezes, close the tab and simplify your regex.
What is the difference between greedy and lazy quantifiers?
Greedy quantifiers (*, +, ?, {n,m}) match as much as possible, then backtrack if needed. Lazy quantifiers (*?, +?, ??, {n,m}?) match as little as possible. For example, applied to '<a><b>', the greedy pattern '<.*>' matches the entire string '<a><b>', while the lazy pattern '<.*?>' matches just '<a>'. Lazy quantifiers are usually preferred when you want to match the smallest possible substring.
How do capture groups work?
Parentheses () create capture groups that remember the matched text. Group 0 is always the entire match. Groups 1-9 correspond to each set of parentheses in left-to-right order. For example, the pattern '(\d{4})-(\d{2})-(\d{2})' applied to '2026-07-21' captures the year (2026), month (07), and day (21) as groups 1, 2, and 3. Our tool displays all capture groups alongside the full match. Use '(?:...)' for non-capturing groups when you don't need to extract the matched text.
What are lookahead and lookbehind assertions?
Lookahead and lookbehind are zero-width assertions that check if a pattern matches (or doesn't match) at the current position, without consuming characters. Positive lookahead (?=...) checks that the pattern follows. Negative lookahead (?!...) checks that it does not follow. Positive lookbehind (?<=...) checks that the pattern precedes. Negative lookbehind (?<!...) checks that it does not precede. For example, '\b\w+(?=ing\b)' matches words ending in 'ing' without including the 'ing' itself.
Is this tool safe for sensitive data?
Yes. All regex processing happens entirely in your browser using JavaScript's native RegExp engine. Your test strings and patterns are never sent to any server, never stored, and never logged. You can verify this by checking your browser's DevTools Network tab — no network requests are made. This makes the tool safe for testing regex against sensitive log data, API keys, or personally identifiable information.
Can I use this tool for regex in Python, Java, or other languages?
Our tool uses JavaScript's RegExp engine, which supports the ECMAScript regex specification. Most basic patterns (character classes, quantifiers, groups, anchors) work identically across languages. However, some advanced features differ: Python uses (?P<name>...) for named groups while JavaScript uses (?<name>...), Java supports possessive quantifiers (a++) which JavaScript does not, and Ruby has different backreference syntax. Always test your final regex in the target language.
Does the tool work on mobile devices?
Yes. The tool is fully responsive and works on iOS Safari and Android Chrome. The interface adapts to small screens with a stacked layout — pattern input on top, test string below, and results at the bottom. On-screen typing of regex special characters is easier with a physical keyboard, but the tool is fully functional on mobile.
Can I use this for commercial projects?
Yes. The tool is free for both personal and commercial use with no watermarks, no attribution required, and no usage limits. You retain full ownership of your regex patterns and test data. There is no registration, no API key, and no subscription required.

Private and Secure

This tool is powered by your browser's own JavaScript engine.

  • No data is ever sent to our servers, so you can test sensitive information with complete confidence.
  • All regex matching, group extraction, and highlighting happen locally in your browser.
  • Your patterns and test strings are never uploaded, stored, or logged.
  • You can safely use this tool with production log data, API responses, and other sensitive content.

You might also like

Helpful guides

Advertisement