Regex Tester
Test regular expressions with real-time match highlighting. Supports all JavaScript regex flags. All processing in your browser.
Pattern
//g
How to Test Regular Expressions Online
- 1.Type your regex pattern into the Pattern field between the slash markers.
- 2.Toggle flags (g = global, i = ignore case, m = multiline, s = dotAll) as needed.
- 3.Enter test text in the Test String area — matches highlight in real time.
- 4.Use Quick Patterns to load common patterns like Email, URL, or IPv4 as starting points.
- 5.Click Copy to copy the full regex with flags for use in code.
Frequently Asked Questions
What regex flavor does this tool use?
This tool uses JavaScript (ECMAScript) regular expressions powered by the browser's native RegExp engine.
What does the g flag do?
The g (global) flag finds ALL matches in the string, not just the first one.
What is the difference between .* and .*?
.* is greedy — it matches as many characters as possible. .*? is lazy — it matches as few characters as possible.
How do I match a literal dot or special character?
Escape it with a backslash: \. matches a literal dot, \* matches a literal asterisk.