Regex (Regular Expressions) Keyboard Shortcuts

Complete Regex (Regular Expressions) keyboard shortcuts and commands reference — 12 shortcuts across 1 categories. Quick reference cheat sheet for Windows & Mac.

Regular expressions are not a program but a notation, and the same dozen tokens appear in every implementation — grep, sed, Python, JavaScript, the search box of an editor. This page lists those tokens. The notes cover what differs between flavours and the two habits that prevent most regex bugs: anchoring and escaping.

Patterns (12)

ShortcutAction
.Any character
\\dDigit
\\wWord char
\\sWhitespace
^Start of line
$End of line
*Zero or more
+ One or more
?Zero or one
[abc]Char class
(group)Group
a|bOR
📜 Source: Regular-Expressions.info — Quick start and reference. Token meanings from the regular-expressions.info reference; flavour differences noted per engine. Checked 2026-09-06. How we verify ›
📄 View Printable Cheat Sheet — Download as PDF or print · 🧩 Combine with other tools

Frequently Asked Questions

What are the most useful Regex (Regular Expressions) keyboard shortcuts?

The most essential Regex (Regular Expressions) shortcuts are: . (Any character), \\d (Digit), \\w (Word char).

What is the Regex (Regular Expressions) shortcut for any character?

The Regex (Regular Expressions) shortcut for any character is ..

What's the fastest way to learn all Regex (Regular Expressions) shortcuts?

Print the Regex (Regular Expressions) cheat sheet and keep it next to your keyboard for the first week, then switch to active recall: open Shortcut Speedrun and practice Regex (Regular Expressions) shortcuts against the clock until they're automatic.

Can I combine Regex (Regular Expressions) shortcuts with other tools?

Yes — use My Stack to combine Regex (Regular Expressions) shortcuts with any other platform on this site into one printable reference, which is useful if your daily workflow spans several tools.

Related Shortcut Pages

VS Code Jupyter Notebook PyCharm Xcode Neovim / Vim WebStorm

Search 18,500+ shortcuts across 268 platforms

Explore All Platforms Practice Shortcuts
🔧 Spotted an error or a missing shortcut? Suggest an edit on GitHub — every accepted fix goes live on this page, the API and the CLI.

The tokens

. matches any single character except (usually) a newline. \\d, \\w and \\s match a digit, a word character (letters, digits, underscore) and whitespace; their capitals match the opposite. [abc] is a character class — any one of those — and [a-z] a range, with [^…] for "anything but". *, + and ? repeat the preceding item zero or more, one or more, and zero or one times, and {2,5} gives exact counts. (group) captures for later reference and a|b is alternation, which binds loosely — (cat|dog)s needs the parentheses.

Anchors and greed

^ and $ anchor to the start and end of the line (or the whole string, depending on the multiline flag), and forgetting them is how \d+ "matches" a number inside a word. Repeats are greedy — they take as much as possible — so ".*" across "a" and "b" matches the whole span; the lazy form .*? stops at the first closing quote. Escape a metacharacter with a backslash to match it literally: \. for a dot, \( for a parenthesis.

Flavours

Basic grep and sed need backslashes before +, ?, |, ( and ) unless run with -E; Perl-style engines (Python, JavaScript, PCRE, ripgrep) use them bare. Lookarounds ((?=…), (?<!…)) and named groups exist in the Perl family only. When a pattern works in one tool and not another, the flavour is the first suspect.

🤖 Ask AI about Regex (Regular Expressions) shortcuts

Open your assistant with this page preloaded as the source — great for follow-up questions like "which of these work in other apps?"

ChatGPT Claude Perplexity Gemini Grok