ClicksBracket

Free Regex Tester and Explainer

Type a regular expression and some text: every match and group is highlighted as you type, with a replace preview and each part of the pattern explained in plain words.

  • Live matches and groups
  • The pattern in plain English
  • Free, runs in your browser

The pattern, piece by piece

(?<user>start of the group named "user"
[\w.+-]+one of \w.+-, one or more times
)end of the group
@the character "@"
(?<domain>start of the group named "domain"
[\w-]+one of \w-, one or more times
\.the character "."
[\w.]+one of \w., one or more times
)end of the group

Matches

Building redirects or filters for a site move? See our SEO audit services

Regex Cheat Sheet

The pieces most patterns are built from. This tester uses JavaScript's regex engine, the one in every browser and Node.js.

\d \w \s
A digit, a word character (letter, digit or _), a space or line break. Capitals mean the opposite: \D is anything but a digit. MDN: Regular expressions
. ^ $
Any character except a line break; the start of the text; the end. With the m flag, ^ and $ match at each line.
* + ? {2,5}
Repeat: zero or more, one or more, optional, between 2 and 5 times. Add ? after any of them to match as little as possible.
[abc] [^abc] [a-z]
One of the characters listed, any character except them, or a range.
( ) (?: ) (?<name> )
A captured group ($1 in a replace), a group that is not captured, and a named group ($<name>).
a|b (?=x) (?!x)
Either a or b; followed by x; not followed by x. Look-behinds (?<=x) and (?<!x) check what comes before.

How to Build and Test a Regex

Start small, test against real text, then tighten.

  1. Paste real text

    Use text with the matches you want and the ones you do not, so you see both.

  2. Write the pattern a piece at a time

    Check the plain-English table after each piece: it says exactly what each part matches.

  3. Pick the flags

    g to find every match, i to ignore case, m to work line by line.

  4. Preview the replace

    Use $1 or $<name> to reuse groups, and check the result before you run it on real data.

When You Want It Done for You

From one pattern to a whole site that works.

Web design

Fast sites built on modern frameworks, live in 14 days.

Open

SEO audit services

Every technical issue on your site, speed included, with the fix and what it costs you.

Open

SEO services

The 90-Day Lead Engine: rank higher in 90 days or less, or we work free until you do.

Open

Regex Tester Questions

Which regex flavor does this use?
JavaScript's, the engine in every browser and in Node.js. It also matches most patterns written for Python, PHP and Java, though look-behind and named-group syntax can differ.
Why did my pattern stop with a timeout?
Patterns with nested repeats, like (a+)+, can try billions of combinations on some text. The tester stops any run after one second; make the inner repeat more specific.
How do I match a dot or a bracket literally?
Put a backslash before it: \. matches a dot, \( a bracket. Without it, . means any character.
What is the difference between greedy and lazy?
Greedy repeats (.*) take as much as they can; lazy ones (.*?) take as little. For <b>.*?</b> on "<b>a</b><b>b</b>", lazy stops at the first closing tag.
How do I use groups in a replace?
Write $1, $2 for numbered groups or $<name> for named ones in the Replace box. $& inserts the whole match.
Is my text sent anywhere?
No. The pattern runs in your browser, in a separate worker so the page stays responsive.

Want a Site That Is Fast, Accessible and Built to Rank?

Tools fix one thing at a time. A free website plan covers the lot: the pages you need, a copy outline, a fixed price and a launch date, live in 14 days.

  • The pages you need, and the one job each page does
  • What your current site loses, in leads and money
  • A fixed price and a 14-day launch date
  • An honest answer on whether you need a new site at all

Rather talk it through? Call +1 (217) 677-5905

Get your free website plan

We reply within one working day.

No contract, no sales pressure. The plan is yours either way.