About Regex Tester
Quickly test regular expressions with live highlighting, capture groups, and flag controls. Everything runs in your browser for speed and privacy.
How to Use
- Enter your regex pattern and toggle flags like g, i, m, s, u, y
- Paste any text to test against your pattern
- See matches highlighted in the output area
- View a detailed list of matches and capture groups
- Copy the matches for quick sharing
Common Examples
- Emails:
(\w+)@([\w.-]+)
- URLs:
https?:\/\/[^\s]+
- Numbers:
-?\d+(?:\.\d+)?
Flags explained
- g (global): find all matches instead of just the first
- i (ignore case): case‑insensitive matching
- m (multiline): ^ and $ match line boundaries
- s (dotAll):
.
matches newlines
- u (unicode): enables Unicode‑aware matching
- y (sticky): matches from the last index only
Tips
- Use non‑capturing groups
(?:...)
when you don’t need captures
- Prefer specific quantifiers (e.g.,
{1,4}
) to avoid excessive backtracking
- Escape special characters like
?
, *
, +
, ( )
, [ ]
, { }
, \
, ^
, $
, and |
when you mean them literally
Notes
This tool uses the JavaScript RegExp engine in your browser, so behavior follows ECMAScript rules. Extremely complex patterns may run slowly on very large inputs—simplify where possible.