Regex Tester
Test a regular expression against text and see matches live.
Usage examples
Validating an email address format
Enter a regex that checks email format and put several strings in the test string to see at a glance which ones match and which don't.
Building a regex to pull a pattern out of log lines
Paste real log text and adjust your regex to see in real time whether it correctly picks out dates, IPs, or error codes.
Extracting just part of a match with capture groups
Use parentheses to create capture groups and confirm that only the part you want — like the year, month, and day of a date — is being pulled out.
Frequently asked questions
Is my text sent to a server?
No. All matching happens entirely in your browser, and the pattern and text you enter are never sent to a server.
What regex syntax does this use?
It uses your browser's JavaScript (ECMAScript) regex syntax directly. Syntax can differ slightly from other languages like Python or PCRE.
What happens if I turn off the "g" flag?
Without the "g" (global) flag, it finds only the first match, just like calling .exec() once in real code.
What happens if my pattern is invalid?
If the pattern itself isn't valid — unbalanced parentheses, for example — the exact error message JavaScript reports is shown.