Regex Cheatsheet - Regular Expression Quick Reference

Quick reference for regular expression patterns. Character classes, quantifiers, anchors, and common patterns.

Share
Back to Regex Cheatsheet

Word Boundary \b

Anchor

Matches word boundary (position between word and non-word char)

Pattern

\b

Syntax

Explanation

\b is a zero-width assertion matching position, not a character.

Examples

\bcat\b

Exact match of word "cat"

Matches: cat

\b\w+\b

Matches all words

Matches: hello, world

Related Tools

More Text Tools