Ad Space
Back to all tools

Regex Tester

Test regular expressions live with match highlighting, capture group display, replace mode, and flag toggles. Browser-native JavaScript regex engine — instant results.

Samples:
/
/
Enter a regex and test string to see results…
Test String

Regex Quick Reference

Click any pattern to paste it into the regex box →

.Any character except newline
\dAny digit [0-9]
\DAny non-digit
\wWord char [a-zA-Z0-9_]
\WNon-word character
\sAny whitespace char
\SAny non-whitespace
^Start of string/line
$End of string/line
\bWord boundary
*0 or more (greedy)
+1 or more (greedy)
?0 or 1 (optional)
{n,m}Between n and m times
( )Capture group
(?:)Non-capturing group
(?=)Positive lookahead
(?!)Negative lookahead
[abc]Character class (a, b, or c)
[^abc]Negated class (not a, b, c)
a|bAlternation — a or b
*?0 or more (lazy)
+?1 or more (lazy)
[a-z]Range — lowercase a to z

How to Use the Regex Tester

1

Enter Pattern

Type your regex in the pattern box. Toggle flags (g, i, m, s) as needed.

2

Paste Test String

Paste the text you want to test the pattern against — results update live.

3

View Matches

See matches highlighted, with capture groups, positions, and replace output.

Frequently Asked Questions

Is this tool free?

Yes — 100% free, no login, no limits.

What flavour of regex does this use?

This tool uses the JavaScript RegExp engine natively built into your browser. JavaScript regex is ECMAScript-compliant and supports most common patterns — character classes, quantifiers, anchors, groups, lookaheads/lookbehinds, and Unicode. It does not support POSIX classes or lookbehinds in older browsers.

What do the flags mean?

g (global) — find ALL matches, not just the first.
i (case-insensitive) — treat uppercase and lowercase as equal.
m (multiline) — ^ and $ match start/end of each LINE, not just the whole string.
s (dotAll) — . matches newline characters too.

How do I use capture groups in Replace?

In the Replace field, use $1, $2, etc. to reference capture groups from your pattern. For example, with pattern (\w+) (\w+) and replacement $2 $1, "John Smith" becomes "Smith John". Use $& to insert the full matched text.