← All text tools

Regex Cheat Sheet

A searchable regular expression cheat sheet covering anchors, classes, quantifiers, groups and lookarounds, with a live tester for every example.

  • Free
  • No sign-up
  • Works on any device

About Regex Cheat Sheet

Regular expression syntax is compact and easy to forget. This cheat sheet groups the pieces you need into anchors, character classes, escapes, quantifiers, groups, lookarounds and flags, with one plain sentence for each and a note on which flavours support it, because JavaScript, Python, Java, PCRE and .NET differ in places such as named groups, possessive quantifiers and lookbehind. Press Try beside any example to load its pattern and sample text into the live tester, which highlights every match and lists the captured groups.

How to use Regex Cheat Sheet

  1. Search the sheet or choose a group such as Quantifiers or Lookarounds.
  2. Press Try beside an example to load its pattern, flags and sample text into the tester.
  3. Edit the pattern or the sample and watch the highlighted matches change.

Why use this tool?

Also known as

Frequently asked questions

What is the difference between greedy and lazy quantifiers?

A greedy quantifier such as .+ takes as much text as it can, while a lazy one such as .+? takes as little as possible. On <b>x</b> the pattern <.+?> matches each tag separately.

Which regex flavour does the live tester use?

It uses the JavaScript engine of your browser. The Flavours column tells you where syntax may behave differently in Python, Java, PCRE or .NET.

Why does my pattern need the u flag for \p{L}?

In JavaScript, Unicode property escapes only work in Unicode mode. Add the u flag in the flags box and the pattern will match letters of any script.

Is Regex Cheat Sheet free?

Yes. Regex Cheat Sheet on Toolipedia is free to use, with no sign-up and no watermark.

Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

Can I put Regex Cheat Sheet on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

Related tools