Learn Before
Concept

Character Classes

  • \w matches any alphanumeric character, so a-z, A-Z, 0-9 and _.
  • \W matches non-alphanumeric characters.
  • \d matches digits (0-9).
  • \D matches any non-digits.
  • \s matches whitespace characters, including newlines, tabs, or spaces.
  • \S matches non-whitespace characters.
  • \n matches newline characters.
  • \t matches tab characters.

0

1

Updated 2021-08-24

Tags

Python Programming Language

Data Science

Related