Copied!
Developer Tool

Regex Tester & Debugger

Test and debug regular expressions in real time with instant match highlighting, capture group extraction, and detailed match information. This free online regex tester uses JavaScript's native RegExp engine and supports all flags including global (g), case-insensitive (i), multiline (m), dotAll (s), and unicode (u). Paste your pattern and test string to see matches highlighted instantly. All processing happens client-side — nothing is sent to a server.

regex-tester.tool
/ / gi
0 characters
Results will appear here...

Frequently Asked Questions

How do I test a regular expression online?
Enter your regex pattern in the pattern field and paste your test string below. Matches are highlighted in real time as you type. This tool uses JavaScript's native RegExp engine — the same engine that runs in Chrome, Firefox, Node.js, and Deno. Capture groups are extracted and displayed with their index and position. All processing runs in your browser with zero server calls.
What do the regex flags g, i, m, s mean?
g (global) — find all matches, not just the first. i (case-insensitive) — /abc/i matches "ABC", "Abc", etc. m (multiline) — ^ and $ match start/end of each line, not just the whole string. s (dotAll) — . matches newline characters (\n). u (unicode) — enables full Unicode support and proper handling of surrogate pairs.
What is the difference between greedy and lazy regex matching?
Greedy quantifiers (*, +, {n,}) match as much text as possible. Lazy quantifiers (*?, +?, {n,}?) match as little as possible. Example: on the string <b>hello</b>, the greedy pattern <.*> matches the entire string, while the lazy <.*?> matches only <b>. Use lazy quantifiers when you want the shortest possible match.
How do I validate an email address with regex?
A practical email regex is: ^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}$. This covers the vast majority of valid email addresses. The full RFC 5322 specification is extremely complex and nearly impossible to match with a single regex. For production applications, use a dedicated email validation library or send a confirmation email rather than relying on regex alone.
What are capture groups in regex?
Capture groups use parentheses () to extract specific parts of a match. For example, the pattern (\d{4})-(\d{2})-(\d{2}) on the string "2026-03-20" creates three groups: "2026", "03", "20". Named groups use (?<name>...) syntax for clearer code. Non-capturing groups (?:...) group patterns without capturing — useful for alternation like (?:cat|dog).