Test String
Results
0 matches
Test String
Replace Results
0 replacements
Characters
. | Any character except newline |
\d | Digit (0-9) |
\D | Not a digit |
\w | Word character (a-z, A-Z, 0-9, _) |
\W | Not a word character |
\s | Whitespace |
\S | Not whitespace |
Quantifiers
* | 0 or more |
+ | 1 or more |
? | 0 or 1 |
{3} | Exactly 3 |
{3,} | 3 or more |
{3,5} | 3 to 5 |
*? | Lazy (non-greedy) |
Groups & Lookaround
(...) | Capture group |
(?:...) | Non-capture group |
(?<name>...) | Named capture group |
(?=...) | Positive lookahead |
(?!...) | Negative lookahead |
(?<=...) | Positive lookbehind |
(?<!...) | Negative lookbehind |
Character Classes
[abc] | a, b, or c |
[^abc] | Not a, b, or c |
[a-z] | Range (a to z) |
[0-9] | Digit range |
Anchors
^ | Start of string/line |
$ | End of string/line |
\b | Word boundary |
\B | Not word boundary |
Flags
g | Global - find all matches |
i | Case insensitive |
m | Multiline - ^ and $ match line boundaries |
s | Dotall - . matches newlines |
u | Unicode |
Common Patterns (Click to Try)
📧
Email
[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}
🔗
URL
https?://[\w.-]+(?:\.[a-zA-Z]{2,})(?:/[\w./?#&=-]*)?
📞
Phone (KR)
0\d{1,2}-\d{3,4}-\d{4}
🌐
IPv4
\b(?:\d{1,3}\.){3}\d{1,3}\b
📅
Date (YYYY-MM-DD)
\d{4}-(?:0[1-9]|1[0-2])-(?:0[1-9]|[12]\d|3[01])
🏷️
HTML Tag
<([a-zA-Z][a-zA-Z0-9]*)\b[^>]*>(.*?)</\1>
🎨
Hex Color
#(?:[0-9a-fA-F]{3}){1,2}\b
About Regex Tester
Regex Tester lets you test and debug regular expressions in real time with visual match highlighting, capture group extraction, and a replace mode. Regular expressions are powerful but notoriously difficult to write correctly without immediate visual feedback.
Use it to build and test a regex for validating email addresses or phone numbers, to extract specific fields from log lines, to find patterns in text before using them in code, or to test a replacement pattern before running a batch find-and-replace. The built-in cheat sheet covers the most common tokens and quantifiers, so you don't need to memorize the syntax.
All regex execution runs locally in your browser using JavaScript's native RegExp engine.