$ ./guess_the_languageRegex
Regex · medium · #17

In POSIX ERE (grep -E), which bracket expression matches a single digit?

echo "a1 b22" | grep -oE '<class>+'
  1. [[:digit:]]
  2. [:digit:]
  3. [[:num:]]
  4. [[digit]]
POSIX character classes like [:digit:] are only valid inside a bracket expression, hence the double brackets.
Play Regex ▸