Cheatsheet Pages / Regex Cheatsheet

How to match whole words only in regex — \b word boundary

You want cat, but not cats, concat, or educate.

Patterns use the syntax shared by PCRE / Python / JavaScript; engine differences are flagged in the cheatsheet where they matter. Test any pattern at regex101.com — and pick the matching engine.

\bcat\b
# matches "cat" but not "cats", "concat", or "educate"
Regex Cheatsheet one-page card — patterns that actually work
The full one-page card — Regex Cheatsheet. Get the complete cheatsheet on GitHub