Regex Tester
Test JavaScript regular expressions live: flags, matches, capture groups and replace preview.
Patterns and test text are processed in your browser and never sent to a server. Results follow JavaScript RegExp semantics.
Flags
Examples
Results
Waiting for input
What is this tool?
A free regex tester that highlights matches as you type. It shows every match with its index, length and capture groups, and includes a replace mode with a live preview.
How to use
- Enter a pattern, choose flags, and paste your test text.
- Matches are highlighted and listed with capture groups.
- Switch to Replace mode to preview substitutions with $1-style references.
Use cases
- Debugging a pattern before shipping it in code.
- Extracting emails, URLs or dates from log text.
- Verifying named capture groups and replacement templates.
Notes
- Use "Escape special characters" to quote a literal string before building a pattern.
- All matching runs locally in your browser.
FAQ
Which regex flavor is used?
JavaScript's RegExp. Results — including capture groups, flags and replacements — follow what your browser's JavaScript engine does.
What do the flags mean?
g finds all matches, i ignores case, m makes ^ and $ match per line, s lets . match newlines, u enables Unicode mode, and y matches only from lastIndex (sticky).
Is there a limit on input size?
Matching runs in a worker with a time budget and stops after 1,000 matches. Very slow patterns time out with an error so the page stays responsive.
Related tools
Days Calculator
Calculate the number of days between two dates, or the date N days from now.
Age Calculator
Calculate exact age from a date of birth, including days lived and next birthday.
Business Days Calculator
Count business days excluding weekends and Japanese national holidays.
Character Counter
Count characters, lines, paragraphs and bytes of text in real time.
PDF Tools
Merge, extract and rotate PDF pages locally in your browser.
Markdown Editor
Write Markdown with live preview, HTML copy and .md download.
Scientific Calculator
Trigonometry, logarithms, exponents, factorials, history and memory.
Unit Converter
Convert length, weight, area, volume, temperature and data size.
Timestamp Converter
Convert between Unix timestamps, ISO 8601 and local date-times.
Percentage Calculator
Percentages, increase/decrease rates, discounts and reverse calculation.
Image Compressor
Compress JPEG, PNG and WebP images in bulk, entirely in your browser.
Image Converter
Convert between HEIC, JPEG, PNG, WebP and more without uploading files.
QR Code Generator
Create QR codes for URLs, text and Wi-Fi credentials in your browser.
Color Palette Extractor
Extract color palettes from images and copy them as CSS variables.
Hash Calculator
Compute and verify MD5, SHA-256 and other hashes for text and files.
Password Generator
Generate strong passwords, passphrases and PINs locally.
HMAC Checker
Compute HMAC signatures and verify webhook signatures in your browser.
Web Page Snapshot
Save the current page as a single self-contained HTML file.
Clipboard Cleaner
Clean invisible characters, extra line breaks and width inconsistencies.
Speed Test
Measure download/upload speed and ping in your browser.
Network Diagnosis
Check connectivity, DNS, IPv6 and the node you are connected through.
JSON Formatter
Format, validate and minify JSON with precise error locations.
URL Encoder / Decoder
Encode and decode URLs and query strings, including non-ASCII text.
Line of Code Counter
Count total, blank, comment and code lines of pasted source code.
DNS Lookup
Query DNS records (A, AAAA, MX, TXT and more) with TTLs, DNSSEC and ASN hints.
CSV Checker & Converter
Check CSV/TSV structure, detect encoding (UTF-8, BOM, Shift_JIS) and convert to JSON.
Text & JSON Diff Checker
Compare two texts or JSON documents and review additions, deletions and changes in your browser.