Enter your pattern
Type a regular expression and choose your flags. If the pattern is invalid, the tool tells you what is wrong instead of failing silently.

Regex tester
A free regex tester that shows every match, every group, and the replace result as you type, all inside your browser.
How it works
No account and no setup. Three steps cover most sessions.
Type a regular expression and choose your flags. If the pattern is invalid, the tool tells you what is wrong instead of failing silently.

Paste a log line, a sample payload, or a block of text. Every match is highlighted right away, and the match list shows each position and its groups. It's a simple way to do regular expression testing without writing a line of code.

Add a replacement such as 3/2/$1 to preview the result. When the pattern behaves, copy it into your project. If your test text comes from a JSON response, tidy it first with the JSON Formatter.

Features
Match, group, replace, and debug in one private editor.
Matches highlight as you type, so over-matching is obvious at once. A fast online regex tester with no run button.
See each match with its position, so you know exactly where it starts and ends.
Numbered and named groups are listed for every match, so you can confirm what each set of parentheses grabbed.
Try $1, $2, or $<name> and see the final text before you commit to it.
Switch g, i, m, s, u, and y on and off to see how each one changes the result.
A broken pattern is explained, not ignored. A friendly regex checker while you are still learning the syntax.
Uses the same RegExp engine your JavaScript runs on, so a regex expression tester result matches what you'll see in the browser or Node.
A focused regex editor with flags beside the field and no clutter around it.
Your pattern and text stay in your browser. Nothing is uploaded, stored, or logged.
Examples
Two quick cases. They also work as a regex tester example you can paste straight into the editor.
Split an ISO date into year, month, and day, then rearrange them.
(\d{4})-(\d{2})-(\d{2})Released 2026-01-15, patched 2026-02-03.
Matches
2026-01-15 groups: 2026, 01, 15
2026-02-03 groups: 2026, 02, 03
Replace with 3/2/$1
Released 15/01/2026, patched 03/02/2026.Match lines that start with a level tag, and capture the level and the message.
^\[(ERROR|WARN)\] (.+)$[INFO] Server started
[ERROR] Database timeout
[WARN] Cache miss rate high
Matches
[ERROR] Database timeout groups: ERROR, Database timeout
[WARN] Cache miss rate high groups: WARN, Cache miss rate highReference
Treat these as a starting set, a small regex generator you adjust by hand for your own data. Switch between the two tabs below.
Simple email[\w.+-]+@[\w-]+\.[\w.]+ — Good for rough checks, not full email validationHex color#(?:[0-9a-fA-F]{3}){1,2}\b — Matches #fff and #1a2b3cUUID[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12} — Use the i flag for uppercaseIPv4 shape\b(?:\d{1,3}\.){3}\d{1,3}\b — Matches the shape only, not the 0-255 rangeURLhttps?:\/\/[^\s]+ — Stops at the first spaceConcepts
A short guide to the parts of a pattern people most often trip over during regular expression testing.
Capture groups
Parentheses grab part of a match. The pattern (\d{4})-(\d{2}) captures the year and month separately, making them accessible through $1 and $2 in replacement strings.
Named groups
(?<year>\d{4}) lets you refer to a group by name, such as $<year>, which is easier to read in longer patterns.
Non-capturing groups
(?:...) groups things together without saving them, which keeps your numbering tidy.
Greedy vs. lazy
.* grabs as much as it can. .*? grabs as little as it can. Lazy is often what you want between two markers.
Lookaheads and lookbehinds
(?=...) and (?<=...) check what surrounds a match without including it in the result.

Audience
Anyone who writes, reads, or fixes patterns.
Check form rules, route patterns, and string cleanup before they ship.
Shape log parsers and alert rules against real log lines. Java developers can sketch a pattern in this java regex tester style and then confirm the details in their own runtime.
Build quick filters to find IDs, codes, or odd entries in exports.
Clean up copied text in bulk with a replace preview.
Use cases
Tasks that take seconds here instead of a run-and-retry loop in code.
Test a pattern for phone numbers or codes against good and bad examples.
Try your pattern on real lines, then use the UUID Generator for extra test IDs.
Preview a replace result before you apply it anywhere.
Strip noise from a log line, then open what is left in the JSON Formatter.
Adapt one of the examples above, like a regex generator for the usual jobs, then tune it on your own text.
Settle the pattern here, then paste it into your code with confidence.
Good to know
A passing test is a good sign, not a guarantee.
This tool uses the JavaScript RegExp engine. Java, Python, and PCRE share most basics but differ on features like possessive quantifiers and atomic groups, so recheck anything advanced in your own language.
Try empty strings, extra spaces, and odd characters, not just clean examples.
Nested quantifiers such as (a+)+ can slow to a crawl on long text. If the tab freezes, simplify the pattern.
Don't use it to read structured data like JSON or HTML. Use a proper parser, and the JSON Formatter for JSON.
A backslash often needs doubling inside string literals, so a pattern that works here may need adjusting when you paste it.
Why this tool
A tab that stays open all day has to be fast, quiet, and trustworthy.
No run button and no waiting.
Check what each set of parentheses captured, then preview the final text.
A broken pattern is explained, so you fix it instead of guessing.
What you test is what your JavaScript will run.
Compare how g, i, m, and s change a result in seconds.
A regex tool that never sends your text anywhere.
Runtime
100% client-side
Engine
Live RegExp engine
Account
No sign-up required
Comparison
Plenty of sites call themselves an online regex tester, an online regex tool, or even a regex builder online. Some are closer to an online regular expression builder with form fields, and others are plain boxes with a match count. If you're choosing a regex expression tester, compare what matters most day to day, not just looks.
This regex tester
If you want a regex generator that writes patterns for you, that's a different kind of tool. This one is for writing your own and proving it works.
Try Regex TesterPrivacy
Matching, grouping, and replacing all happen in your browser. We don't upload your pattern or your test text, and we don't keep a copy. That makes this regex tester safe for log lines, internal data, and anything you wouldn't paste into a random site. It's a regex tool that stays out of your way. If your test text includes tokens, read them first with the JWT Decoder, which works the same local-only way.
Start a project
Have a project, product idea or development challenge? Let's discuss how I can help turn it into a reliable, scalable web application.
$
Usually replies within 24 hours
What brings you here?