Tag: regular expressions

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] […]

Java Regular Expressions – 1

What is Java Regular Expressions? From Oracle, it says “Regular expressions are a way to describe a set of strings based on common characteristics shared by each string in the set.” In order to define that common characteristics, we prepare a sequence of characters called ‘Pattern’. These patterns can be used to search, edit, or […]