Tag: Predefined Character Classes

Java Regular Expressions – 4

Predefined Character Classes This is shorthand of Character Classes. Instead of mentioning the character range, we will mention the predefined type of the character. Construct Description . Any character (may or may not match line terminators) \d A digit: [0-9] \D A non-digit: [^0-9] \s A whitespace character: [ \t\n\x0B\f\r] \S A non-whitespace character: [^\s] \w A word character: [a-zA-Z_0-9] […]