

or \u002E), you must precede it with the escape character ( \.). Wildcard: Matches any single character except \n. By default, characters in character_group are case-sensitive.Ĭharacter range: Matches any single character in the range from first to last. Negation: Matches any single character that is not in character_group. Matches any single character in character_group. For more information, see Character Classes. Character classes include the language elements listed in the following table. This allows the regular expression engine to disambiguate language elements (such as * or ?) and character literals (represented by \* or \?).Ī character class matches any one of a set of characters. For example, \* is the same as \x2A, and \. When followed by a character that is not recognized as an escaped character in this and other tables in this topic, matches that character. Matches a Unicode character by using hexadecimal representation (exactly four digits, as represented by nnnn). Matches the ASCII control character that is specified by X or x, where X or x is the letter of the control character. Uses hexadecimal representation to specify a character ( nn consists of exactly two digits). Uses octal representation to specify a character ( nnn consists of two or three digits). "\r\nThese" in "\r\nThese are\ntwo lines." ( \r is not equivalent to the newline character, \n.) In a character class, matches a backspace, \u0008. For more information, see Character Escapes. The backslash character (\) in a regular expression indicates that the character that follows it either is a special character (as shown in the following table), or should be interpreted literally. We've also provided this information in two formats that you can download and print for easy reference: NET Regular Expressions.Įach section in this quick reference lists a particular category of characters, operators, and constructs that you can use to define regular expressions.

A pattern consists of one or more character literals, operators, or constructs. A regular expression is a pattern that the regular expression engine attempts to match in input text.
