Step: Shorthand classes: \d \w \s
Shorthand classes: \d \w \s
Common classes have shorthands: \d = digit [0-9], \w = word char [A-Za-z0-9_], \s = whitespace. Their uppercase forms negate: \D, \W, \S.
Why it matters: shorthands make patterns shorter and clearer than spelling out ranges.
Example: \d+ matches each run of digits.
Your turn: pull out every number with \d+.
Pitfall: \w includes the underscore and digits — it is not "letters only". For letters use [A-Za-z].
Input:
Expected:
Step 6 of 11