Regex Cheatsheet

What is a Regex Cheatsheet?

Comprehensive quick-reference cheatsheet for JavaScript Regular Expressions (Regex). Look up syntax for character classes (`\d`, `\w`, `\s`), quantifiers (`*`, `+`, `?`, `{n,m}`), anchors (`^`, `$`, `\b`), groups, lookaheads `(?=...)`, and lookbehinds (?<=...).

Why Use This Tool?

  • Fast Regex Syntax Search: Quickly lookup syntax for positive lookaheads `(?=...)`, negative lookbehinds (?<!...), or non-capturing groups `(?:...)`.
  • Copy Common Patterns: Copy battle-tested regex patterns for emails, URLs, IP addresses, dates, and passwords.
  • Character Class Reference: Verify the difference between `\d`, `\D`, `\w`, and `\W`.

How to Use

  1. Search or browse regex categories (Anchors, Quantifiers, Character Classes, Lookarounds).
  2. Click any regex syntax pattern to view plain-English explanation and example.
  3. Copy regex code snippet to your clipboard.

Real Working Example

Input:

Search: "Lookahead"

Output Result:

Positive Lookahead: (?=pattern) – Matches a suffix without including it in the match result.

Important Technical Details & Specifications

  • ES2022 Regex Standards: Covers modern JavaScript RegExp features including Unicode property escapes `\p{L}` and dotAll flag `/s`.
  • Interactive Search Filter: Filter cheatsheet by keyword (e.g. `lookbehind`, `quantifier`, `anchor`).
  • 100% Offline Access: Cheatsheet data is stored locally in browser memory.

Related Developer Tools

Frequently Asked Questions

What is the difference between \d and \w in regex?

`\d` matches any digit (0-9); `\w` matches any word character (letters A-Z, a-z, digits 0-9, and underscore _).

What is a lookahead in regex?

A lookahead asserts that what follows the current position matches a specific pattern without consuming characters.

Is it free?

Yes, 100% free.

What does the ^ and $ anchors mean?

`^` matches the start of a string (or line); `$` matches the end of a string (or line).

What is the main function of Regex Cheatsheet?

Quick reference cheatsheet for JavaScript Regular Expression (Regex) character classes, quantifiers, lookaheads, and flags. This tool processes regex cheatsheet data 100% locally inside your web browser.