Predefined character classes

There is a set of predefined character classes. The following table explains these.

Character class Meaning
. Matches any character other than newline
\w Matches a "word" character, alphanumeric plus underscore (_)
\W Matches a non-word character
\s Matches a whitespace character
\S Matches a non-whitespace character
\d Matches a digit character
\D Matches a non-digit character
[:alnum:] Alphanumeric characters *
[:alpha:] Alphabetic characters *
[:blank:] Space and tab characters *
[:cntrl:] Control characters *
[:digit:] Numeric characters *
[:graph:] Characters that are printable and are also visible. (A space is printable, but not visible, while an "a" is both.) *
[:javastart:] Start of a Java identifier *
[:javapart:] Part of a Java identifier *
[:lower:] Lower-case alphabetic characters *
[:print:] Printable characters (characters that are not control characters) *
[:punct:] Punctuation characters (characters that are not letter, digits, control characters, or space characters) *
[:space:] Space characters (for example, space, tab, and form feed) *
[:upper:] Upper-case alphabetic characters *
[:xdigit:] Characters that are hexadecimal digits *
\p{Alnum} Alphanumeric characters †
\p{Alpha} Alphabetic characters †
\p{Blank} Space and tab characters †
\p{Cntrl} Control characters †
\p{Digit} Numeric characters †
\p{Graph} Characters that are printable and are also visible. (A space is printable, but not visible, while an "a" is both.) †
\p{Lower} Lower-case alphabetic characters †
\p{Print} Printable characters (characters that are not control characters) †
\p{Punct} Punctuation characters (characters that are not letter, digits, control characters, or space characters) †
\p{Space} Space characters (for example, space, tab, and form feed) †
\p{Upper} Upper-case alphabetic characters †
\p{Xdigit} Characters that are hexadecimal digits †

* For regular expressions used with the Transaction Manager rule ~ (match) operator see LDAP domain DN filter (see Manage DN filters for a domain).

† For all other regular expressions.

Related Links