Regex Tester Online - Live Match Highlight and Replace Preview
Free regex tester with live match highlighting, capture group tables and replacement preview. Eight built-in presets, all processed locally in your browser.
Last updated: 2026-11-10
Online Regex Tester
Flags
Common pattern cheat sheet
Click a preset to load its pattern, flags and sample text
Match results
Highlighted preview
Match details
| # | Match | Position | Groups |
|---|
Replacement result
Fully local: Patterns and text are processed only in your browser, never uploaded or saved; only flag preferences are stored locally.
How to use Online Regex Tester
Test regular expressions online with instant results: enter a pattern and sample text to see highlighted matches, exact positions and capture groups, then try a replacement template and preview the rewritten text. Eight ready-made patterns cover emails, phone numbers, URLs and more. Everything runs on the native RegExp engine in your browser, nothing is uploaded.
- 1
Enter a pattern and flags
Type only the pattern itself, without the surrounding slashes, then tick the flags you need: g replaces all matches, i ignores case, m makes ^ and $ line-based, s lets the dot match newlines, u enables Unicode and y matches from the last position.
- 2
Paste the test text
Drop the text you want to match into the box. The preview and match table always scan globally so you can see every hit at once, even without g; the replacement result follows your selected flags exactly.
- 3
Read the highlight and groups
Matches are highlighted in the preview and the table lists each index, matched text, character range and the values of $1, $2 and later groups. Zero-width matches get a thin marker so they are never silently lost.
- 4
Try a replacement template
Use $& for the whole match, $1 for the first group, $$ for a literal dollar sign and so on. The rewritten text appears immediately, so you can validate bulk renames, masking or field reordering before pasting it back into code.
- 5
Copy or download
Copy prefers the replaced text, or the match list when no template is set. Download saves the result as a TXT file. Pattern, text and template stay in browser memory only and disappear on refresh.
Key features
Live feedback
Recalculates 160 ms after you stop typing, with elapsed time shown in the stats line. No run button needed.
Full picture of every match
Highlight preview, detail table and capture groups work together, including zero-width matches and multiline text.
Eight built-in presets
Email, phone, URL, IPv4, date, hex colour, number and blank-line patterns load with matching sample text in one click.
Local and guarded
Native RegExp runs locally; a 500-character pattern cap, 20,000-character text cap and 2,000-match cap keep things responsive, zero-width matches advance automatically and nested quantifiers trigger a warning.
Common use cases
Check validation rules
Try email, phone or ID patterns against real data before shipping, and catch false positives early.
Debug log extraction
Confirm group boundaries on a short sample before pulling IPs, dates or order numbers from large logs.
Learn groups and backreferences
Watch $1 and $2 change as you edit the pattern instead of adding print statements to your code.
Rehearse a bulk replace
Verify the replacement template before a refactor or data cleanup so nothing is rewritten by accident.
Find out why nothing matched
Paste a minimal repro and toggle i/m/s/u to see which flag or escape is the culprit.
Frequently asked questions
Do I need the surrounding slashes?
No. Slashes are literal delimiters in some languages; type just the pattern, for example \b\w+@\w+\.\w+\b, and pick flags with the checkboxes below.
Why do I see many matches without the g flag?
The highlight and table always scan globally so you can review every hit. The replacement follows your flags exactly, so without g only the first occurrence is replaced. The two views are deliberately different.
Which replacement patterns are supported?
All JavaScript String.replace substitutions: $& for the whole match, $1 through $99 for groups, $` and $' for surrounding text, $$ for a literal dollar sign and $<name> for named groups.
What if the page slows down?
Nested quantifiers such as (a+)+ can backtrack catastrophically on long input, and the tool warns when it sees that shape. A synchronous RegExp cannot be interrupted in the browser, so the tool caps patterns at 500 characters, text at 20,000 characters and matches at 2,000. Shorten the text or rewrite the pattern if needed.
Which regex flavour is this?
The browser native RegExp engine: character classes, groups, lookaround, named groups and Unicode property escapes where the browser supports them. .NET or PCRE-only syntax and recursive patterns are not supported.
Is my text uploaded or stored?
No. Matching and replacement happen in browser memory with no network request. Only your flag preferences are kept in localStorage; patterns and text are never saved.
Related tools
Bulk URL Opener
Open a list of URLs in new tabs at once: paste plain lines or any text, extract links automatically, fix missing protocols, dedupe, and export bookmarks.
Morse Code Translator
Translate text to Morse code and Morse back to text as you type. Covers A-Z, digits and punctuation, plays the signal at 5-25 WPM, and includes a full chart.
HTML CSS JS Formatter
Online HTML, CSS and JS formatter with custom indent, line wrapping and compact mode. Embedded style and script blocks are formatted too, all in your browser.
AES Encrypt & Decrypt
Free AES encryption tool: encrypt text with AES-GCM or CBC via Web Crypto, PBKDF2-hardened passwords, self-contained Base64 output, decrypt with same password.
Color Converter
Free color converter online: switch between HEX, RGB and HSL instantly, with RGB sliders, a live preview swatch, 3-digit shorthand support and one-click copy.
Base Converter
Free base converter with four linked inputs for binary, octal, decimal and hexadecimal, BigInt-exact for huge integers and 12 fractional digits, with a 0-16 reference table.
URL Encoder and Decoder
Free URL encoder and decoder with three modes (component, whole URL, form data), multi-pass decoding and a query parser that exports key-value pairs as JSON.
UUID Generator
Free UUID v4 generator: create 1 to 1000 UUIDs at once with crypto.randomUUID, switch case and hyphens, export as text, JSON or SQL, and download.
Hash Calculator
Free online hash calculator: get MD5, SHA-1, SHA-256, SHA-384, SHA-512 and CRC32 for any text or file at once, with per-hash copy and uppercase output.
JSON Formatter
Free JSON formatter: beautify with 2 or 4 spaces, minify, sort keys, and get the exact line and column of a syntax error, plus size, depth and node counts.
