Regex Tester
Test, debug and visualize regular expressions in real time. Supports JavaScript regex syntax with live matching and replace.
Ad Space
/
/
Test String
Ad Space
Match Results
0 matches
Highlighted Text
Match Details
Replace Result
Common Patterns — Click to Use
Ad Space
What is Regex?
A regular expression (regex) is a sequence of characters that defines a search pattern. Regular expressions are used for pattern matching within strings — to find, replace, or validate text data.
How to Use This Tool
- Type your regex pattern in the input field above
- Select flags (global, case-insensitive, multiline, etc.)
- Enter your test string in the text area
- Matches are highlighted in real time
- Use the replace field to test regex replacements
- Click any common pattern to quick-insert it
Common Regex Syntax
- . — Matches any character (except newline)
- \d — Matches any digit [0-9]
- \w — Matches any word character [a-zA-Z0-9_]
- \s — Matches any whitespace character
- * — Matches 0 or more of the preceding element
- + — Matches 1 or more of the preceding element
- ? — Matches 0 or 1 of the preceding element
- {n,m} — Matches between n and m times
- [abc] — Matches any character in the set
- (group) — Capturing group
- ^ — Start of string/line
- $ — End of string/line
FAQ
Is my data stored or sent to a server?
No. All regex matching happens in your browser using JavaScript. No data is transmitted anywhere.
Which regex flavor does this tool support?
This tool uses JavaScript's built-in RegExp engine. It supports the g, i, m, s, and u flags.
How do capture groups work?
Wrap part of your pattern in parentheses to create a capture group. Groups are shown in the match details and can be referenced with $1, $2, etc. in the replace field.
Can I use lookahead and lookbehind?
Yes, modern browsers support lookahead (?=...), negative lookahead (?!...), lookbehind (?<=...), and negative lookbehind (?<!...).