Character classes in Linux

Here is the list of character classes in Linux. They are used in pattern matching.

  1. [:alpha:] matches letters only.
  2. [:digit:] matches numbers only.
  3. [:alnum:] matches letters and numbers only.
  4. [:xdigit:] matches hexadecimal numbers.
  5. [:lower:] matches a-z.
  6. [:upper:] matches A-Z.
  7. [:blank:] matches a space or a tab.
  8. [:space:] matches white space and horizontal tab.
  9. [:cntrl:] matches control characters.
  10. [:print:] Printable characters in the range of ASCII 32 – 126.

You may also like...