Regex Tester
Write and test regular expressions with real-time match highlighting, capture groups, and flag support.
Why Use PixConvert Regex Tester
Real-time regex testing with no server round-trips.
Live Match Highlighting
Matches highlighted in the test string as you type — see exactly what your pattern captures.
Capture Groups
Named and numbered capture groups listed separately for each match. Essential for complex extraction patterns.
All JS Flags
Toggle g, i, m, and s flags with one click. Flags apply immediately to all matches.
Error Detection
Invalid regex patterns show the exact error message from the JavaScript engine. No cryptic failures.
Match Count
Total match count and individual match positions shown instantly for global searches.
100% Private
Native JavaScript RegExp — everything runs in your browser with no network calls.
Common Regex Use Cases
Regex is used everywhere from form validation to log parsing.
Form Validation
Test email, phone, password, and ZIP code regex patterns before shipping to production.
- Email validation patterns
- Phone number formats
- Password complexity rules
Log Parsing
Extract fields from server logs, nginx access logs, and structured text files.
- Parse IP addresses
- Extract timestamps
- Capture error codes
Data Extraction
Scrape structured data from HTML or plain text using capture groups.
- Extract URLs from text
- Parse CSV-like formats
- Find and replace with groups
How to Test a Regex
Enter your regular expression pattern and select flags. Type your test string below.
Matches are highlighted in real time. Capture groups are listed beneath each match.
Toggle flags (g, i, m, s, u) and read the explanation pane to verify your pattern behaves the way you expect.
Explore More Tools
Discover other free tools that work great alongside this one
Diff Checker
Compare two texts side by side
JSON Formatter
Format, validate, and minify JSON instantly
URL Encoder
Encode and decode URL components
Markdown to HTML
Convert Markdown to clean HTML
Base64 Encoder
Encode and decode Base64 strings
Hash Generator
Generate MD5, SHA-1, SHA-256 hashes
Frequently Asked Questions
Regular expressions explained.
Which regex flavor does this use?
This tester uses JavaScript's native RegExp engine (ECMAScript regex). It supports standard character classes, quantifiers, anchors, lookahead/lookbehind, named capture groups, and Unicode property escapes (\p{L}, etc. with u flag).
What does the g flag do?
The g (global) flag makes the regex find all matches in the string instead of stopping after the first one. Without g, only the first match is returned.
How do I use named capture groups?
Use (?<name>pattern) syntax. For example, (?<year>\d{4})-(?<month>\d{2}) captures year and month as named groups. Results appear in the Groups section.
Why does my regex work in one language but not here?
Different regex engines support different features. JavaScript does not support: lookbehind in older browsers, atomic groups, possessive quantifiers, backreferences in character classes, or the \K operator (common in PCRE/Python). Check the JS-specific syntax if your pattern uses these.
What is the s (dotAll) flag?
By default, the dot (.) matches any character except newlines. With the s flag, dot also matches \n and \r. This is essential for patterns that span multiple lines.