Top horizontal ad space

Regex Tester

Test and debug regular expressions with real-time matching and highlighting. All processing happens in your browser.

Top ad space
//g
Flags:

Common Patterns

Quick Reference

.Any character
\dDigit (0-9)
\wWord char
\sWhitespace
^Start of line
$End of line
*0 or more
+1 or more
?0 or 1
{n}Exactly n
[abc]Any of a,b,c
()Capture group

🔒 Privacy First: All regex testing happens in your browser. Your patterns and text are never sent to any server.

Bottom ad space

How to Use

  1. Enter your regular expression pattern
  2. Select the flags you need (g, i, m, s)
  3. Enter or paste your test text
  4. View highlighted matches and capture groups
  5. Optionally test replacements with the replace feature

About Regular Expressions

Regular expressions (regex) are powerful patterns for matching and manipulating text. They're essential for validation, searching, and text processing in programming.

This tester uses JavaScript's RegExp engine, which supports most standard regex features including lookahead (?=), lookbehind (?<=), and named groups (?<name>) in modern browsers.

Frequently Asked Questions

What regex flavor does this tester use?

This tester uses JavaScript's native RegExp engine. It supports standard regex syntax including character classes, quantifiers, anchors, groups, lookahead, and lookbehind (in modern browsers).

What do the regex flags mean?

g (global) finds all matches, not just the first. i (case-insensitive) ignores letter case. m (multiline) makes ^ and $ match line boundaries. s (dotall) makes . match newlines. u (unicode) enables full Unicode support.

How do I match special characters?

Special characters like . * + ? ^ $ {} [] \ | ( ) need to be escaped with a backslash. For example, to match a literal dot, use \. instead of just a dot.

What are capture groups?

Capture groups are created with parentheses () and allow you to extract specific parts of a match. For example, (\d{4})-(\d{2})-(\d{2}) captures year, month, and day separately from a date.

Why isn't my regex matching anything?

Common issues include: forgetting to escape special characters, missing the global flag for multiple matches, case sensitivity (try the i flag), or incorrect anchors (^ and $ in multiline text).

Is my data secure when using this tool?

Yes, all regex testing happens entirely in your browser using JavaScript. Your patterns and test text are never sent to any server, ensuring complete privacy.