Skip to main content

Regex Cheatsheet

Quick reference for regular expression syntax, flags, and patterns.

regexreferencecheatsheet
Read the guide
Shortcuts:⌘ KSearch

Frequently Asked Questions

Can I actually run a regex against text on this page?

No. This page is reference-only. It links out to the site's separate Regex Tester if you want to try a pattern against live input.

Why does a token like \A, lookbehind, or named groups fail in my language?

Because the sheet mixes broadly useful regex syntax with some engine-specific features. The tool even labels \A and \Z as engine-specific, so not every token here will work in JavaScript, RE2, POSIX, or every backend.

When I click Copy, does it copy the whole example?

No. The Copy button on each card copies the token or pattern shown in the main syntax box, not the example snippet underneath it.

Can I filter down to anchors, quantifiers, flags, or common patterns?

Yes. The top tabs let you filter by categories such as Anchors, Character Classes, Quantifiers, Flags, and Common Patterns, and the search box works at the same time.

Are the email and URL patterns here safe as final production validators?

Think of them as practical starter patterns, not perfect validators. The tool itself describes them as simple or loose matchers, which is the right way to use a cheatsheet like this.

Related Tools