Regex Tester

Instantly test your regular expressions against text with live highlighting, a replace mode, and a detailed capture group breakdown.

Flags
Common Patterns

Match ResultsMatched parts are highlighted
The regular expression and text you entered are processed only within your browser and are not sent to the server. Uses JavaScript (ECMAScript) regex syntax.
Regex Syntax Cheatsheet
PatternMeaningExample
.Any single character except newlinea.c โ†’ abc, a1c
\d \DDigit / Non-digit character\d{4} โ†’ 2026
\w \WAlphanumericยทunderscore / Other\w+ โ†’ hello_1
\s \SWhitespace (spaceยทtabยทnewline) / Non-whitespacea\sb โ†’ a b
[abc]Any one character in brackets[๊ฐ€-ํžฃ] โ†’ One Korean character
[^abc]Any one character not in brackets[^0-9] โ†’ Not a digit
*0 or more repetitionsab*c โ†’ ac, abbc
+1 or more repetitionsab+c โ†’ abc, abbc
?0 or 1 repetition (optional)colou?r
{n,m}n to m repetitions\d{3,4} โ†’ 123, 1234
*? +?Non-greedy (lazy) quantifier<.+?> โ†’ one tag at a time
^ $Start / End of string (or line)^http
\bWord boundary\bcat\b โ†’ only "cat"
|ORcat|dog
(...)Capture group โ€” extracts results separately(\d{4})-(\d{2})
(?:...)Non-capturing group (for grouping only)(?:ab)+
(?<name>...)Named capture group(?<year>\d{4})
(?=...)Positive lookahead (only if followed by this)\d+(?=์›)
(?!...)Negative lookahead (only if NOT followed by this)foo(?!bar)
\.Treat special characters literally (escape)\. \( \[ \\

What is the Regex Tester?

Regular expressions are powerful for finding and replacing patterns, but one small error can lead to frustrating results. This regex tester gives you immediate feedback by highlighting matches in your text as you type your pattern or select flags. Toggle between "๐Ÿ”Ž Match" and "๐Ÿ” Replace" modes to instantly see substitutions. If your pattern uses capture groups, a detailed table breaks down each captured value and its position. And since all testing is done entirely within your browser, you can safely work with sensitive data without it ever leaving your computer.

How to use

  1. Enter your pattern in the "Regex Pattern" field and select flags like "g Global (find all)" or "i Case insensitive".
  2. Paste or type the content you want to search into the "Text to Test" area.
  3. Matches are highlighted instantly in the "Match Results" box, with total "Matches" and "Time Taken (ms)" shown above.
  4. If your pattern includes capture groups (...), a "Capture Groups" table appears below, detailing each group's value and position.
  5. Click the "๐Ÿ” Replace" button, enter a "Replacement String" (using "$1" for groups), and see the final output in the "Replacement Result" box.

Frequently asked questions

What regex flavor does this use?

This tool uses your browser's built-in JavaScript (ECMAScript) regex engine. All standard flags ("g", "i", "m", "s", "u", "y") are supported.

Is it safe to test sensitive data here?

Yes. All processing, from matching to replacing, happens entirely within your web browser. Your regex pattern and test text are never sent to our servers.

Why does my browser freeze or the test stop?

To prevent freezes from inefficient patterns (e.g., nested quantifiers like (a+)+), the test automatically stops if it takes longer than 1.2 seconds.

Can I save my favorite regex patterns?

You cannot save custom patterns, but you can instantly load presets like Email, URL, and IPv4 via the "Common Patterns" buttons, which also provide sample text.