Back to Dev Tools
Regex Tester
Test regular expressions, inspect capture groups, highlight matches, and evaluate RegExp flags online. 100% client-side, fast, private, and secure.
100% Client-Side Local Browser Execution
Regex evaluation runs entirely inside your local browser instance. Your patterns and test texts are never uploaded or transmitted to external servers.
Quick Regex Syntax Reference
.Any character (except newline)\dAny digit (0-9)\wWord character (a-z, A-Z, 0-9, _)\sWhitespace (space, tab, newline)^Start of string or line$End of string or line*0 or more occurrences+1 or more occurrences?Optional (0 or 1 occurrence){n}Exactly n occurrences{n,m}Between n and m occurrences[...]Character class (matches any in set)[^...]Negated class (matches any not in set)(...)Numbered capture group(?:...)Non-capturing group(?<x>)Named capture group "x"|Alternation (OR condition)What Is a Regular Expression?
A regular expression (regex) is a pattern that describes text to match, extract, or validate — used for things like checking an email format, pulling numbers out of a log line, or finding every occurrence of a word.
How to Use the Regex Tester
- Enter a pattern and the text you want to test it against.
- Toggle flags (g, i, m, s, u) to control global matching, case sensitivity, multiline anchors, dot-all mode, and Unicode handling.
- Matches and capture groups highlight directly in your test text as you type.
- Use the built-in examples to explore common patterns like emails or URLs.
Technical Notes
- This tool uses the JavaScript RegExp engine, so behavior matches what you'd get in a browser console or Node.js — not PCRE, Python's re, or POSIX regex, which differ in some edge cases.
- Capture groups — parts of the pattern wrapped in parentheses — let you extract specific pieces of a match rather than just detecting one.
- The g flag finds every match in the text; without it, matching stops after the first one.
Frequently Asked Questions
Why does my pattern only return 1 match?+
By default, JavaScript RegExp evaluates in non-global mode and stops after finding the first match. Enable the "g" (Global) flag to find all matching occurrences in your test text.
How are match indexes calculated?+
Match positions use standard zero-based character indexing. The Start index indicates the exact 0-indexed offset of the first character, and End index equals Start + Match Length.
