Regex Tester
Test regex patterns with live matches and groups
Enter a pattern and test string,
then click Test Regex
Quick Reference
.Any char except newline\dDigit [0-9]\wWord char [a-zA-Z0-9_]\sWhitespace^Start of string/line$End of string/line*0 or more+1 or more?0 or 1 (optional){n,m}Between n and m(...)Capture group(?:...)Non-capture group(?<name>...)Named group[abc]Character class[^abc]Negated classa|bOR โ a or bSponsored
Related Tools
Markdown Editor
Write, preview, and export Markdown with live rendering
Git Commit Generator
Paste a git diff and generate clean conventional commit messages instantly
Email Validator
Validate email addresses, inspect domains, and generate mailto links
URL Parser
Break URLs into parts and query parameters
Free Online Regex Tester โ Test Regular Expressions in Real Time
This free online regex tester lets you write, test, and debug regular expressions against any string with live match highlighting. Supports JavaScript regex syntax with all standard flags: global (g), case-insensitive (i), multiline (m), and dotAll (s).
Whether you're validating email addresses, parsing log files, extracting data from text, or building input validation rules, this regex tool gives you instant feedback without switching to a terminal.
What you can test with this tool
- Email validation regex:
/^[\w.-]+@[\w.-]+\.[a-z]{2,}$/i - URL matching: extract links from raw text
- Named capture groups:
(?<year>\d{4})-(?<month>\d{2}) - Lookaheads and lookbehinds for complex pattern matching
- Multi-line log parsing and structured data extraction
Regex flags explained
g (global) โ find all matches, not just the first. i (ignoreCase) โ match regardless of letter case. m (multiline) โ make ^ and $ match line boundaries. s (dotAll) โ make . match newline characters too.
FAQ
Which regex flavor does this tool use?
JavaScript (ECMAScript) regex, powered by the browser's native RegExp engine. This matches the syntax used in Node.js, React, and all modern browsers.
How do I match a literal dot or parenthesis?
Escape special characters with a backslash: \. matches a literal dot, \( matches a literal parenthesis.