Skip to content

Regex Cheatsheet

Interactive regex syntax reference with descriptions, examples, and a try-it-live tester for each pattern.

Loading...
1. Browse regex syntax elements by category (character classes, anchors, quantifiers, groups, lookahead/lookbehind, flags). 2. Click on any pattern element to see its description, syntax breakdown, and practical examples. 3. Use the inline mini-tester for each element to type a test string and see matches highlighted in real time. 4. Modify the regex pattern in the mini-tester to experiment with variations and understand how the syntax works. 5. Scroll to the "Common Patterns" section to find ready-to-use regexes for emails, URLs, phone numbers, and more. 6. Copy any pattern or example using the copy button to paste it directly into your code.

About This Tool

The Regex Cheatsheet is an interactive reference for regular expression syntax that goes beyond static tables. Each pattern element includes a clear description, practical examples, and a live tester where you can try the pattern against sample text to see matches highlighted in real time.

Regular expressions are organized by category: character classes, anchors, quantifiers, groups and backreferences, lookahead and lookbehind, flags, and common patterns. Each section builds on the previous ones, making it useful both as a quick reference and as a learning tool.

The built-in tester for each pattern element lets you modify the regex and test string to experiment with how each construct works. This hands-on approach makes it much easier to understand complex concepts like non-greedy quantifiers, lookaheads, and named capture groups compared to reading about them in documentation.

Frequently Asked Questions

This reference covers JavaScript/ECMAScript regular expressions, which are the most commonly used in web development. Most patterns also work in other languages (Python, Java, C#), with notes on important differences where they exist.
The Regex Tester is a full-featured tool for writing and testing complete regular expressions. This Cheatsheet is a reference that explains each regex syntax element individually with mini-testers for learning. Use the cheatsheet to learn, and the tester to build.
Yes, the cheatsheet covers positive and negative lookaheads (?=...) (?!...) and lookbehinds (?<=...) (?<!...) with examples and interactive testers. It also notes browser support for lookbehinds which were added more recently.
The cheatsheet includes a section of common patterns for email validation, URLs, phone numbers, IP addresses, dates, and more. Each pattern includes explanations of how it works and known limitations.

Related Tools

Regex Tester

Test regular expressions with real-time match highlighting, group capture display, and a pattern library.

Developer Tools

Git Cheatsheet

Searchable interactive Git command reference organized by workflow - branching, merging, rebasing, and more.

DevOps Tools

Find and Replace

Find and replace text with support for regular expressions, case-sensitive matching, and whole-word search options.

Text and Writing

JSON Formatter and Validator

Format, validate, and beautify JSON data with syntax highlighting, tree view, and error detection.

Developer Tools