Enter a pattern, tick the g, i, m, s, u, and y flags you need, paste your test text, and the matches light up in the panel below. Invalid patterns are flagged inline as you type, so you can fix a stray bracket or escape without leaving the page, and each match is broken out with its position, length, and capture groups.
Regex Tester Online
Regex Tester Online checks a regular expression against your sample text live in the browser: type a pattern, tick the flags you need, and every match highlights as you type. Each match shows its start position, length, and capture-group contents, so an empty group is easy to spot.
One-click starter patterns for email, URL, IPv4, phone, and date let you adapt a working expression instead of starting from a blank box - a pattern that looks right can still miss the strings you care about, so you confirm exactly what it catches before you paste it into code.
What this tester does, and what it leaves to you
It is a read-only matcher: you supply the pattern and it shows live matches, rather than generating an expression for you or rewriting your text. Matching uses standard JavaScript regex syntax; your pattern and text never leave the browser tab.
It also shows what a pattern matches, not why it works: there is no plain-English breakdown of each token, so a symbol you do not recognize is on you to look up rather than something this box explains.
Porting a pattern from Python, PHP, or Perl
A pattern written for a PCRE-style engine can need adjusting here: named subroutines and conditional patterns are not supported at all, and lookbehind only works in modern browsers. If a pattern that runs fine elsewhere throws a syntax error in this box, that mismatch is the most likely reason.
Which flags to tick, and when
The six flag boxes change how the same pattern behaves, and the defaults are not always what you want. Toggle any box and the highlight and the per-match breakdown refresh immediately, so a flag's effect is visible without rerunning anything:
| Flag | What it changes | Tick it when |
|---|---|---|
g global | Lists every match in the text instead of stopping at the first | You want to see all matches; untick it to just confirm the pattern matches at all |
i ignore case | Letters match regardless of case | cat should also catch Cat and CAT |
m multiline | ^ and $ anchor to the start and end of each line | The text has several lines and you anchor per line, not per block |
s dotall | . also matches across line breaks | A single . should cross newlines |
u unicode | Enables \p{...} property classes and astral characters | The pattern includes Unicode property escapes or emoji |
y sticky | Each match must begin exactly where the previous one ended | You match contiguous tokens from a fixed position |
Named groups, the match count, and what stops a runaway pattern
When your pattern uses a named group like (?<year>\d{4}), Regex Tester Online lists it in the match panel as Group <year>: 2026 alongside the numbered groups, so you can confirm the name resolves to the value you expect without counting parentheses. A summary line above the match list updates live as you edit either field, counting the matches found or telling you which of the pattern and the test text is still missing.
A pattern that matches zero-length strings, such as x* against text with no x, cannot loop forever here: the match loop advances past an empty match instead of re-matching the same position, and a hard cap stops the count at 100,000 matches so one runaway pattern never freezes the tab.
Where the regex tester fits in your workflow
A pattern rarely travels alone. Once it matches the way you want, paste two revisions of a config or log file into text diff to confirm only the lines you intended changed after a find-and-replace, or validate a JSON payload the pattern will run against in the JSON parser first. The developer tools hub collects the rest of the format, minify, and hash set, all running in-browser with no upload.
FreetoolOnline Editorial TeamFrequently Asked Questions
What does Regex Tester Online do?
Test a regular expression against your own sample text and watch every match highlight as you type.
When should I reach for regex tester online?
Reach for it when a pattern is not catching what you expect and you want to confirm exactly which characters it matches before pasting it into code.
Are there starter patterns I can build from?
One-click starter patterns for email, URL, IPv4, phone, and date give you a working expression to adapt instead of beginning from a blank box.
Does regex tester online show named capture groups?
Yes - a group written as (?<name>...) is listed by its name in the match breakdown, alongside any numbered groups in the same match.
What does the Clear button reset?
It empties both the pattern and the test text, reruns the matcher so the panel resets, and moves focus back to the pattern field.