Free Regex Tester · Real-Time Matching · Find & Replace
Free Regex Tester Online — Test Regular Expressions
Write a regex pattern, paste test text, and see all matches with their index positions and capture groups. Supports g, i, m, s flags. Optional find-and-replace with backreferences.
//
Common Regex Patterns
Email address
[a-zA-Z0-9._%+\-]+@[a-zA-Z0-9.\-]+\.[a-zA-Z]{2,}Phone number (US)
\+?1?[\s\-.]?\(?\d{3}\)?[\s\-.]?\d{3}[\s\-.]?\d{4}URL (http/https)
https?:\/\/(www\.)?[\w\-]+(\.[\w\-]+)+[\/\w\-.?=%&#+]*IPv4 address
\b(?:\d{1,3}\.){3}\d{1,3}\bDate (YYYY-MM-DD)
\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])Hex color code
#(?:[0-9a-fA-F]{3}){1,2}\bFAQ — Regex Tester
What regex flavor does this tester use?
JavaScript (ECMAScript) regex engine — the same used in browsers and Node.js. It supports most PCRE-style syntax but does not support lookbehind in older browsers, atomic groups, or possessive quantifiers.
How do I use capture groups?
Wrap part of your pattern in parentheses: (\d+). The matched group is shown in the results next to the full match. Named capture groups use the syntax (?<name>\w+).
What does the "g" flag do?
"g" (global) finds all matches, not just the first one. Without it, the regex stops after the first match. For most use cases, you want the "g" flag enabled.
Can I do find and replace with regex?
Yes — fill in the "Replace With" field and click Test Regex. Backreferences like $1, $2 refer to captured groups. Use $& to insert the whole match.
What is the "s" (dotAll) flag?
By default, . does not match newline characters. With the "s" flag enabled, . matches every character including \n. Useful for matching across multiple lines.