Regular Expression
/ / g
Test String
Replace with:
Match Results
Enter a regex pattern and test string to see matches.
Common Patterns
Regex Cheat Sheet

Character Classes

.Any character (except newline)
\dDigit [0-9]
\DNon-digit
\wWord char [a-zA-Z0-9_]
\WNon-word character
\sWhitespace
\SNon-whitespace
[abc]Any of a, b, or c
[^abc]Not a, b, or c
[a-z]Character range a to z

Quantifiers

*0 or more
+1 or more
?0 or 1 (optional)
{n}Exactly n times
{n,}n or more times
{n,m}Between n and m times
*?0 or more (lazy)
+?1 or more (lazy)

Anchors & Boundaries

^Start of string/line
$End of string/line
\bWord boundary
\BNon-word boundary

Groups & Lookaround

(abc)Capture group
(?:abc)Non-capturing group
(?<name>)Named capture group
\1Back-reference to group 1
(?=abc)Positive lookahead
(?!abc)Negative lookahead
(?<=abc)Positive lookbehind
(?<!abc)Negative lookbehind
a|bAlternation (a or b)
Ready — enter a regex and test string above 100% client-side

Free Online Regex Tester

Test and debug your regular expressions instantly with our free online regex tester. Whether you are validating form inputs, parsing log files, or extracting data from text, this tool gives you real-time match highlighting, capture group details, and a powerful find-and-replace feature. Everything runs in your browser — no signup, no data stored on servers.

Features

How to Use

  1. Enter your regex pattern in the pattern field at the top
  2. Toggle the desired flags (g, i, m, s, u) using the flag buttons
  3. Type or paste your test string in the text area below
  4. Matches are highlighted in real time. Check the Match Results panel for details including capture groups
  5. To replace, enter a replacement string and click Replace All

Frequently Asked Questions

Is my data safe?

Yes. All regex matching and replacement happens entirely in your browser using JavaScript. No data is sent to any server. Your text never leaves your machine.

Which regex flavor does this tool use?

This tool uses JavaScript's built-in RegExp engine. It supports all modern features including named capture groups, lookbehinds, and the unicode flag. The syntax is compatible with most web and Node.js applications.

What do the flags mean?

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

How do I use capture groups in replacement?

Use $1, $2, etc. to reference numbered capture groups, or $<name> for named groups. $& inserts the entire match, and $$ inserts a literal dollar sign.

Related Tools: JSON Formatter | Text Diff Checker | Base64 Encoder/Decoder