GUIDE深度 · Deep dive

Regex Basics: Classes, Quantifiers, Anchors

Start with character classes and quantifiers: \d digits, \w word characters, + one or more, * zero or more, ? zero or one. Anchors ^ and $ pin the string. Escape special characters.

更新 2026-10-30 · 公式可核验

Common symbols

\d digit, \w word character, \s whitespace.

+ / * / ? control repetition.

Anchors

^ start, $ end.

\b word boundary.

FAQ

What does . match?

Any character except newline by default.

How to match a literal dot?

Escape it as \.

Sources

Related calculators

Regex Practice: 1000 Gamified Match and Replace Cards1000 Python regex cards covering character classes, quantifiers, groups, anchors, search and substitution, in 50 levels with spaced repetition.

More guides

Hiragana vs KatakanaRead guideSpaced Repetition and the Forgetting CurveRead guideOn Readings vs Kun ReadingsRead guideAn N5 Kanji Study OrderRead guide