ConvertProKitConvertProKit

Regex Cheat Sheet: Common Patterns and Syntax Explained

DFDaniel FosterTools & Privacy Writer July 21, 2026 7 min read 1,629 words

Quick summary

Regular expressions look intimidating because many symbols are packed into a short string, but the actual vocabulary is small: character classes describe what kind of character to match, quantifiers describe how many times, and anchors describe where in the text. Combining a handful of these covers the vast majority of patterns developers write day to day, from validating an email address to finding a phone number.

Key takeaways

  • Character classes (\d, \w, \s, and custom [abc] sets) describe what kind of character can appear at a position.
  • Quantifiers (*, +, ?, {n,m}) describe how many times the preceding element can repeat.
  • Anchors (^, $, \b) describe position — start/end of string or line, or a word boundary — rather than matching characters themselves.
  • Groups (...) and alternation (a|b) let a pattern match one of several alternatives, or capture part of a match for reuse.
  • Testing a pattern against real example text before using it in code catches most mistakes immediately.

A regular expression like `^\S+@\S+\.\S+$` looks like noise until you know that each symbol has one specific, narrow job. Once those jobs are clear, dense-looking patterns become readable, and writing your own becomes a matter of combining a small, familiar toolkit rather than memorizing endless special cases.

This cheat sheet covers the core syntax used in almost all everyday regex, with the plain-English meaning of each piece.

Character classes: what kind of character

`\d` matches any digit (0-9). `\w` matches any "word" character — letters, digits and underscore. `\s` matches any whitespace — space, tab or newline. A custom set in square brackets, like `[aeiou]`, matches any one character from that exact set, and `[^aeiou]` (a caret right after the opening bracket) matches any character NOT in that set. A period `.` matches almost any single character at all.

Quantifiers: how many times

`*` means zero or more of the preceding element. `+` means one or more. `?` means zero or one — effectively "optional." `{3}` means exactly three, and `{2,5}` means between two and five. So `\d+` matches one or more digits in a row, and `colou?r` matches both "color" and "colour" because the `u` is optional.

Anchors and groups: where, and how to structure a match

`^` anchors a match to the start of the string (or line, depending on mode), and `$` anchors it to the end — `^\d+$` matches a string that is entirely digits, nothing before or after. `\b` marks a word boundary, useful for matching a whole word like "cat" without also matching it inside "category."

Parentheses `(...)` group part of a pattern together, both to apply a quantifier to the whole group and to capture that piece of the match for later use. The pipe `|` inside or outside a group means "or" — `cat|dog` matches either word.

Try the Regex Tester

Free, private and instant. It runs entirely in your browser with nothing uploaded.

Open Regex Tester

Step-by-step guide

Testing a pattern with ConvertProKit's Regex Tester:

  1. Open the Regex Tester — no signup, nothing to install.
  2. Type your pattern and some real example text to test it against.
  3. See matches highlighted instantly as you adjust the pattern.
  4. Copy the working pattern into your code once it matches correctly.

Quick answer

What does \d+ actually mean? \d matches any single digit; + means "one or more" of whatever came before it. Together, \d+ matches a run of one or more digits. In short, the Regex Tester lets you handle regex tester for free, directly in your browser, with your files staying private on your own device the entire time.

Common use cases

People turn to regex tester for all sorts of everyday reasons. If any of these sound familiar, the Regex Tester is built for exactly your situation:

  • Knocking out a small, recurring digital task without breaking your flow.
  • Getting professional-looking output without expensive software.
  • Protecting your privacy and security across the tools you use daily.
  • Working smoothly on any device, including locked-down or borrowed machines.
  • Replacing several scattered websites with one trusted, private toolkit.

Whatever brought you here, the process is the same — quick, free and handled entirely on your own device — so you can get the result you need and move on.

Free ConvertProKit tools for this workflow

Everything in this guide is powered by free tools that run entirely in your browser — nothing is uploaded, there is no signup, and there are no watermarks or limits. These are the ConvertProKit tools that work best alongside the Regex Tester for regex tester:

Because each one processes files on your own device, you can chain them together — for example convert, then resize, then compress — without a single file ever leaving your computer. That combination of speed and privacy is the whole point of a browser-based toolkit: there is no upload to wait for, no queue, and no server holding a copy of your data afterward.

All of these tools are part of the wider ConvertProKit collection of free online utilities, so once you are set up for regex tester you have dozens of related image, PDF, text and productivity tools a click away — every one of them free, private and instant, with nothing to install and no account to create.

Tips to get the best results

A few habits make regex tester smoother and keep your results consistently high quality. Keep these in mind whenever you use the Regex Tester:

  • Bookmark one trusted, privacy-first toolkit so you never have to gamble on an unknown site mid-task.
  • Favour tools that need no signup or install — they are faster to reach and work on any device.
  • Keep sensitive data on your own device by choosing tools that process everything in your browser.
  • Build small, repeatable habits around these tools so the routine tasks stop eating your time.

None of these take extra effort once they become routine, and together they are the difference between a result that is merely acceptable and one that is genuinely polished.

Common mistakes to avoid

Most problems with regex tester come down to a handful of avoidable slip-ups. Steer clear of these and you will get a clean result the first time:

  • Trusting a different unknown website with your files for every small task.
  • Reusing weak or identical passwords instead of generating strong, unique ones.
  • Uploading company or personal data to tools that process it on a server.
  • Reaching for heavyweight software when a quick browser tool would do.

The good news is that every one of these is easy to sidestep once you are aware of it. Take a moment to work from a good original, choose the right settings, and use a tool that keeps your files on your device, and the whole process becomes reliable rather than hit-or-miss. If something does not look right, it usually costs only a few seconds to adjust a setting and run it again — another advantage of doing everything instantly in your browser rather than waiting on a server round-trip.

Is it free and private?

Yes on both counts. The Regex Tester is completely free — no account, no subscription, no watermark and no cap on how many times you can use it. More importantly, it is private by design: the work happens inside your browser using your own device, so your files are never uploaded to a remote server. When you close the tab, nothing is left behind anywhere but on your own machine, which is exactly what you want when regex tester involves anything personal or confidential.

This is a genuinely different model from most "free" online tools, which upload your file to their servers, process it there, and ask you to trust that they delete it afterward. With a browser-based tool there is nothing to trust and nothing to delete, because your data never travelled anywhere in the first place. That is why ConvertProKit can offer these tools free forever without limits — there is no per-file server cost to recover — and why you can use them with sensitive documents and personal photos without a second thought.

Frequently asked questions

What does \d+ actually mean?

\d matches any single digit; + means "one or more" of whatever came before it. Together, \d+ matches a run of one or more digits.

What is the difference between * and +?

* matches zero or more of the preceding element (so it can match nothing at all); + requires at least one.

Why use ^ and $ together?

Anchoring both the start and end forces the entire string to match the pattern, not just some substring inside it — useful for validating that a whole input, like a username, fits a format.

What is a capturing group for?

Parentheses group part of a pattern and also "capture" that matched portion so it can be extracted or reused separately from the rest of the match.

Is regex the same across every programming language?

The core syntax covered here is shared almost everywhere, but some advanced features and exact behavior differ slightly between languages — always test a pattern in the actual environment you will use it in.

The bottom line

Regex reads as a wall of symbols only until each one is unpacked individually — character classes for what, quantifiers for how many, anchors for where, and groups for structure. Once those four categories are second nature, most patterns people actually need are a matter of combining a handful of familiar pieces rather than looking up something new each time.

DF

Daniel Foster

Tools & Privacy Writer

Daniel writes about privacy-first, browser-based tools and how they work under the hood. He focuses on client-side utilities that process files locally and never upload a single byte. More from Daniel

Get new guides in your inbox

Occasional tips on images, PDFs and free browser-based tools. No spam, unsubscribe anytime.