Regex Tester
Paste a JavaScript regular expression and sample text to see every match, numbered group, and named group.
About Regex Tester
Paste a JavaScript regular expression and sample text to see every match, numbered group, and named group. This tester uses the same engine as new RegExp() in your browser - no account and no upload. It is a private check for a pattern you already have, not a replacement for regex101 or RegExr.
How to Use Regex Tester
- Type a JavaScript pattern without wrapping slashes. Toggle flags such as g, i, and m.
- Paste the text you want to test. Matches highlight as you type.
- Open the groups table to inspect numbered and named capture groups.
- Load an email, phone, or URL example if you want a starting pattern.
- If the pattern is invalid, a short error explains the syntax problem. Nothing leaves your browser.
Regex Tester Examples
A simple address pattern finds hello@example.com and support@toolsminify.com in a sentence. It is a starting point, not a full RFC parser.
Phone
A digit-and-separator pattern matches +1 555-0100 and 020-7946-0958. Adjust the character class for the format you actually need.
URL
https?:\/\/[^\s]+ with the i flag matches http and HTTPS URLs in pasted logs. Trailing punctuation is still part of [^\s]+ unless you trim it.
Named capture groups
(?<area>\d{3})-(\d{4}) on Call 555-0100 now yields numbered groups 555 and 0100 plus the named group area.
Frequently Asked Questions about Regex Tester
- How do I test regex online in JavaScript?
- Enter a pattern using JavaScript syntax (no wrapping slashes), choose flags, and paste sample text. Matches, groups, and highlights update in the browser with the same rules as new RegExp().
- What are regex match groups?
- Parentheses capture parts of a match. Group 1 is the first pair of parentheses, group 2 the next, and so on. Named groups use (?<name>...) and appear in the named groups column next to the numbered ones.
- Regex flags explained: what do g, i, m, s, u, and y do?
- g finds every match instead of stopping at the first. i ignores case. m makes ^ and $ match line edges. s lets the dot match newlines. u enables Unicode escapes. y is sticky and only matches at the last index.
- Why does my regex not match?
- Common causes: a special character that needs escaping, a missing g flag when you expected several hits, ^ or $ anchoring more than you meant, or testing against text that uses different line breaks. Try an example pattern first, then change one piece at a time.
- How do I escape special characters in a regex?
- Characters with a meaning in JavaScript regex (. * + ? ^ $ { } ( ) | [ ] \) need a backslash when you want the literal. To match a dot, use \. To match a backslash, use \\. Square brackets and parentheses also need to be closed.
- Is my text uploaded?
- No. The pattern and sample run entirely in your browser. Nothing is sent to a server, logged, or stored. That is why this page is safe for tokens, logs, and config snippets.
Related Tools
Hash Generator
Generate SHA-256, SHA-1, SHA-384, and SHA-512 hashes from any text. Get the lowercase hex digest instantly in your browser - nothing is uploaded.
URL Encoder / Decoder
Encode text and URLs to percent-encoding or decode encoded URLs back to plain text. Switch between encodeURIComponent and encodeURI, right in your browser.
JWT Decoder
Decode JWT header, payload, and signature in your browser. Free JSON Web Token decoder - no signature verification, nothing uploaded.