Regex Tester
Test regular expressions live with color-coded match highlighting, capture groups, replace mode, and common presets.
Test text
44 charsPreview
The quick brown fox jumps over 13 lazy dogs.
[The] [quick] [brown] [fox] [jumps] [over] [13] [lazy] [dogs].
Matches
9 foundMatch 1
0 to 3
The
Match 2
4 to 9
quick
Match 3
10 to 15
brown
Match 4
16 to 19
fox
Match 5
20 to 25
jumps
Match 6
26 to 30
over
Match 7
31 to 33
13
Match 8
34 to 38
lazy
Match 9
39 to 43
dogs
Presets
How to use Regex Tester
-
Enter your regex pattern
Type your regular expression into the pattern input. Do not include the leading and trailing slashes — just the pattern itself.
-
Set flags
Toggle flags: g (global, find all matches), i (case-insensitive), m (multiline, ^ and $ match line boundaries), s (dotAll, dot matches newlines), and u (unicode mode).
-
Add your test text
Paste or type the text you want to test against in the textarea. Matches are highlighted inline in real time as you type.
-
Review match details
The match panel shows the total number of matches, each match's full text and position, and all capture group values including named groups.
-
Test replace mode
Switch to Replace mode and enter a replacement string using $1, $2 for numbered groups or $<name> for named groups. The substituted output is shown live.
Regex Tester FAQ
What regex engine does this use?
Can I test capture groups?
How do I use replace mode?
What flags are supported?
Is there a way to start with a common regex pattern?
Is my test data sent anywhere?
Why does my pattern work in Python/PHP but not here?
Can I test multiline text?
How do I match a literal dot or special character?
Background
Regex Tester is built for developers who need to write, debug, and verify regular expressions without leaving the browser. Enter your pattern and test string and matches are highlighted inline with distinct color-coded spans — each match group gets its own color so you can see overlapping and nested captures at a glance.
The match details panel lists every match with its start position, full match text, and all captured groups (including named captures). Toggle between match mode and replace mode: in replace mode, enter a replacement string using JavaScript's replacement syntax ($1, $2, $&, $`, $', named captures) and see the substituted output live.
Flag toggles give you one-click access to g (global), i (case-insensitive), m (multiline), s (dotAll), and u (unicode) flags. Built-in presets for email addresses, URLs, IPv4, IPv6, dates, phone numbers, and hex colors let you start from a proven pattern and customise from there.
Uses JavaScript's native RegExp engine (ECMAScript 2024), the same engine that runs in Node.js, V8, and all modern browsers. All processing is client-side — your patterns and test data never leave your browser.
Related tools
Diff Checker
Compare two texts, code files, or documents side by side — word-level diff highlighting, private and browser-based.
JSON Formatter
Format, validate, and minify JSON instantly — with configurable indentation, error location, and tree view.
HTTP Status Code Reference
Complete HTTP status code reference with descriptions, causes, and examples — searchable and filterable by category.
Markdown Preview
Write Markdown and see a live GitHub-flavoured HTML preview side by side — export clean HTML instantly.
Word Counter
Count words, characters, sentences, and paragraphs with reading time, speaking time, and keyword density.
Learn more
Regex Cheat Sheet: A Complete Guide to Regular Expressions
Master regular expressions with our comprehensive cheat sheet. Test patterns live, learn character classes, quantifiers, lookaheads, and see 10 practical examples.
developerRegex Patterns You'll Actually Use: Copy-Paste Ready
20+ battle-tested regex patterns for emails, URLs, phone numbers, IPs, dates, and more. Copy-paste ready with examples for developers.