Regular Expression Character Classes


The table  specifies some character classes that can be used with regular expressions. Please do not confuse a character class with a C# class declaration. A character class is simply an escape sequence that represents a group of characters that might appear in a string.

Character class



any digit


any word character


any whitespace


any non-digit


any non-word character


any non-whitespace

A word character is any alphanumeric character or underscore. A white space character is a space, a tab, a carriage return, a newline or a form feed. A digit is any numeric character. Regular expressions are not limited to the character classes . Regular expressions can use other notations to search for complex patterns in strings.

Next Recommended Reading Checking Birthday By Regular Expression