Regex Tester — JavaScript & PCRE Pattern Debugger Tool
Test regex patterns with real-time match highlighting, capture groups visualization, and replacement testing. Supports JavaScript and PCRE flavors.
Features
- ✓Real-time match highlighting — see matches light up instantly as you type your pattern or test string
- ✓Capture groups visualization — all numbered and named groups displayed with their matched content in a structured table
- ✓Detailed match information for each match including exact position (index), length, and full match text
- ✓Regex flag toggles — switch between global (g), case-insensitive (i), multiline (m), dotAll (s), and Unicode (u) modes with one click
- ✓Replacement testing mode — test your replace patterns with $1, $2 back-references and see the result in real time
- ✓Common regex library — one-click load pre-built patterns for email, URL, phone number, IP address, date, password validation, and more
- ✓Syntax error detection with clear, human-readable error messages when your regex is invalid
- ✓Match count statistics — total matches found, total capture groups, and processing time displayed in the status bar
- ✓One-click copy pattern or matches to clipboard for quick sharing with teammates
- ✓Full JavaScript RegExp engine compatibility — uses the browser's native engine so results are identical to your production code
- ✓Entirely client-side processing — zero data transmission, works offline after initial load, perfect for sensitive data like passwords or PII
How to Use
- 1Enter your regular expression pattern in the "Pattern" field at the top. Use forward slashes (/pattern/) or enter the raw pattern without delimiters.
- 2Toggle the flags below the pattern field: g (global — find all matches), i (case-insensitive), m (multiline — ^$ match line boundaries), s (dotAll — dot matches newlines), u (Unicode — full Unicode support).
- 3Paste or type your test string in the input area below. Matches highlight automatically as you type.
- 4View detailed match information in the right panel: each match shows its position, length, captured groups, and the full matched text.
- 5Switch to Replace mode to test substitution patterns. Enter your replacement string with $1, $2 references to use capture groups.
- 6Click any preset pattern from the Common Patterns library to quickly load frequently-used regexes like email validation or URL matching.
- 7Copy the pattern or results using the toolbar buttons. Download matches as a text file if needed.
- 8Use the Regex Explanation panel to break down complex patterns — each token is explained in plain English to help you understand what your regex does.
Frequently Asked Questions
What is a regular expression (regex)?
∨
What do the regex flags mean?
∨
How do capture groups work?
∨
Why does my regex show as invalid?
∨
Does this support PCRE or Python regex?
∨
Is my test data sent to a server?
∨
How does replacement mode work?
∨
Can I test regex performance or detect catastrophic backtracking?
∨
What is the difference between greedy and lazy quantifiers?
∨
How do I match Unicode characters including emoji with regex?
∨
Related Tools
Base64 Encoder/Decoder — Encode & Decode Text Online
Encode text to Base64 or decode Base64 to readable text. Supports UTF-8, emojis, and non-Latin scripts. Drag-and-drop file upload. 100% browser-based.
URL Encoder/Decoder — Percent Encoding Online Tool Free
Encode text to URL-safe percent encoding or decode back to readable text. Supports UTF-8 characters including emojis. Drag-and-drop file upload.
JSON Formatter — Beautify, Validate & Minify JSON Online
Format, minify, pretty-print, and syntax-highlight JSON data. Features key sorting, custom indentation, tree view, error highlighting, and file upload.
JWT Decoder — Decode, Verify & Debug JSON Web Tokens
Decode JSON Web Tokens instantly — view header, payload, and signature. Inspect claims with human-readable timestamps. Detects expired and weak tokens.
Hash Calculator — MD5, SHA-256 & 25+ Algorithms Online
Calculate hashes using 25 algorithms including MD5, SHA-256, SHA3, BLAKE3, and more. Supports HMAC, hash verification, and uppercase/lowercase output.