FlipMyFormat

Regex Tester

Test regular expressions live with highlighted matches, a full capture-group breakdown including named groups, every flag, and a replace preview. Instant, accurate and completely private.

100% Free Live highlighting Named groups Replace preview Data never sent
//g

Your pattern and text are processed on your device and never sent to any server.

People Also Use

Everything This Tool Does

A complete regex workbench in your browser.

Live match highlighting

Every match is highlighted inside your test string as you type the pattern.

Full match details

A table of every match with its position, matched text and all capture groups.

Named group support

Named capture groups are shown by name, not just by number.

All six flags

Toggle global, ignore case, multiline, dot-all, unicode and sticky with tooltips explaining each.

Replace preview

See the full replaced output live, with $1, $2 and named substitutions.

Clear syntax errors

An invalid pattern shows the engine's exact error message instead of failing silently.

Runaway protection

Match scanning is capped so a pathological pattern can't freeze your browser.

Match count

Instantly see how many matches your pattern finds.

Built-in cheatsheet

A reference of the most-used tokens right on the page — no tab switching.

Fully private

Everything runs in your browser — your pattern and data never leave your device.

Regex Cheatsheet

The tokens you reach for most often.

TokenMatches
.Any character except newline
\dA digit, 0 to 9
\wA word character: letter, digit or _
\sAny whitespace
\bA word boundary
[abc]Any one of a, b or c
[^abc]Any character except a, b or c
[a-z]Any character in the range
TokenMeaning
*Zero or more of the previous
+One or more of the previous
?Optional, or make lazy
{2,5}Between two and five times
^ $Start and end of string or line
(abc)Capture group
(?:abc)Group without capturing
(?<n>abc)Named capture group

Engine

JavaScript

Highlighting

Live

Groups

Named too

Flags

All six

Replace

Live preview

Privacy

Never sent

FlipMyFormat vs Other Regex Testers

An honest look at how this free tool compares.

FeatureFlipMyFormatOthers
Data never sent to a serverSometimes
Live match highlighting
Named capture groupsLimited
Replace previewLimited
All six flags with explanationsRare
Built-in cheatsheetRare
No signup / ads-free

How to Test a Regular Expression

Regular expressions are compact to the point of being cryptic, which is why writing one blind and hoping it works is a recipe for frustration. This tester gives you the feedback loop that makes them tractable. Type your pattern and paste the text you want to search, and matches light up inside the text immediately — so you can see not just whether the pattern works, but exactly what it caught and what it missed. Below that, a table breaks down every match: its position in the string, the matched text, and the contents of each capture group, shown by name when you use named groups. Toggle any of the six flags with a tap; each one explains what it does, so you don't have to remember whether m or s is the multiline one. Switch on replace mode to preview a substitution live, using $1 and $2 or named references, which is the fastest way to verify a find-and-replace before running it on real data. Invalid patterns show the engine's own error message rather than failing quietly, and match scanning is capped so a runaway pattern can't lock up the page. Everything runs in your browser, so patterns and sample data stay on your device.

1

Enter your pattern

Type the expression and toggle the flags you need.

2

Paste test text

Matches highlight instantly with a full breakdown below.

3

Refine or replace

Adjust until it's right, then preview a replacement.

Flags Explained

FlagNameEffect
gglobalFind all matches, not just the first
iignore caseMatch regardless of capitalisation
mmultiline^ and $ match at each line break
sdot all. also matches newline characters
uunicodeTreat the pattern as Unicode code points
ystickyMatch only from the exact lastIndex position

Common Use Cases

Validate input formats

Check an email, phone or postcode pattern against real examples.

Extract data from logs

Pull timestamps, IPs or error codes out of log lines.

Bulk find and replace

Preview a substitution before running it across a codebase.

Parse structured text

Capture fields from semi-structured records.

Clean up messy data

Strip unwanted characters or normalise spacing.

Route and redirect rules

Test patterns used in web server and router configuration.

Learning regex

Experiment safely with instant feedback and a cheatsheet.

Debug a failing pattern

See exactly which part of the text your regex is or isn't catching.

Tips & Best Practices

Build up in small steps

Start with a simple pattern that matches too much, then tighten it piece by piece.

Prefer lazy quantifiers

Use *? or +? when greedy matching swallows more than you intended.

Use non-capturing groups

Write (?:…) when you only need grouping, keeping your capture numbers clean.

Name your groups

(?<year>\d{4}) is far more readable than remembering what $3 was.

Watch catastrophic backtracking

Nested quantifiers like (a+)+ can explode in cost — restructure rather than nest.

Escape special characters

A literal dot, slash or bracket needs a backslash, or it means something else entirely.

Troubleshooting

Only the first match is found

Turn on the g flag. Without it the engine stops after the first match.

^ and $ don't match my lines

Enable the m flag so they anchor to each line rather than the whole string.

My dot won't match a newline

That's by design. Turn on the s flag to make . match newline characters too.

The pattern is reported invalid

The exact engine error is shown — usually an unclosed group, bracket or a stray backslash.

Frequently Asked Questions

How do I test a regex for free?

Enter your pattern and paste some test text above. Matches highlight instantly with a full breakdown — free, no signup.

Which regex flavour does it use?

The JavaScript engine built into your browser, which matches how regex behaves in Node.js and front-end code.

Does it support named capture groups?

Yes. Groups written as (?<name>…) are shown by name in the match table.

Can I preview a replacement?

Yes. Turn on replace mode and use $1, $2 or named references to see the substituted output live.

What do the flags do?

g finds all matches, i ignores case, m makes ^ and $ per-line, s lets . match newlines, u enables Unicode mode and y makes matching sticky.

Why does only one match show?

The g flag is off. Enable it to find every match rather than stopping at the first.

Does it show match positions?

Yes. The details table lists the index of every match in the test string.

What happens with an invalid pattern?

You see the engine's own error message, such as an unterminated group, instead of a silent failure.

Can a bad pattern freeze the page?

Match scanning is capped, so a runaway or pathological pattern can't lock up your browser.

Is my pattern or data sent anywhere?

No. Everything runs in your browser, so nothing leaves your device.

Does it work with Python or PCRE regex?

Most syntax is shared, but some constructs like lookbehind support and named group syntax differ between flavours.

How many matches can it show?

The table lists up to two hundred matches, while the count reflects everything found.

Can I copy the matches?

Yes. One click copies all matched strings, or the full replaced text in replace mode.

What is a non-capturing group?

(?:…) groups part of a pattern without creating a numbered capture, keeping your group numbers tidy.

What is catastrophic backtracking?

Nested quantifiers can make the engine try exponentially many paths. Restructure the pattern rather than nesting quantifiers.

Does it work offline?

Once the page has loaded it runs entirely in your browser, so it keeps working without a connection.

Does it work on phones?

Yes, in any modern browser on Windows, Mac, Android or iPhone with nothing to install.

Is this tool really free?

Completely free, forever — no account, no ads and no premium wall.

100% free · No signup · Processed in your browser · Data never sent

Last updated: August 2026 · FlipMyFormat Regex Tester
Written and maintained by the FlipMyFormat team · Runs entirely in your browser