25.27. The RegExp Object
Netscape 4.0 introduced the RegExp object to represent regular expressions and added support for it in the String object through the match, replace, search, and split methods.
new RegExp("pattern") This constructor builds a regular expression. A regular expression is a string containing some special characters that Java uses to check for occurrences of certain patterns in strings. These characters are listed in Table 25.1, but the most important three are +, which means “match one or more occurrences of the previous character”; *, which means “match zero or more occurrences of the previous character”; and ?, which means “match zero or one occurrence of the previous character.” In the absence of these special ...