Regex Tester
Test regular expressions with live match highlighting and group capture
//g
Matches will appear here...
Matches: 0
What is a Regex Tester?
A Regex Tester is an interactive tool that lets you write, test, and debug regular expressions in real time. It highlights matches in your test string, displays captured groups, and flags syntax errors — helping you build and refine patterns without the trial-and-error of writing regex blind.
How to Use This Regex Tester
- Type your regex pattern between the slashes, or pick a common pattern from the quick-select buttons.
- Toggle flags like g (global), i (case-insensitive), m (multiline), or s (dotAll) as needed.
- Enter your test string in the input area.
- Matches are highlighted live in the result panel, with captured groups listed below.
- Fix any syntax errors flagged by the tool and iterate until your pattern works.
Common Use Cases
- Validating form inputs such as email addresses, phone numbers, and URLs.
- Building search-and-replace patterns for text processing or log parsing.
- Testing regex for .htaccess redirects, nginx rules, or routing patterns.
- Debugging patterns that work in one regex flavor but fail in another.
Frequently Asked Questions
What regex flavor does this tester use?
This tester uses the JavaScript RegExp engine, which follows the ECMA-262 specification. Most common patterns are compatible across languages, but advanced features like lookbehind or named groups may behave differently in PCRE, Python, or Java.
What does each flag do?
g — global: find all matches instead of stopping at the first. i — case-insensitive: match upper and lower case equally. m — multiline: ^ and $ match the start/end of each line. s — dotAll: . also matches newline characters.
Why is my regex showing an error?
Common causes include unescaped special characters, mismatched brackets or parentheses, and invalid quantifiers. The error message from the JavaScript engine will usually indicate the position and nature of the syntax issue.
Related Tools
Developer
JSON Formatter
Format, minify, and validate JSON with syntax highlighting
Developer
Base64 Encode/Decode
Encode and decode Base64 strings with URL-safe support
Developer
JWT Decoder
Decode and inspect JSON Web Tokens
Text
Markdown Preview
Live preview markdown with split-pane editor
Text
Word Counter
Count words, characters, sentences, and readability stats
Security
Password Generator
Generate strong passwords with customizable options and strength meter