This is another example of regular expression.
In this example we are using Pattern class to compile the regular expression string.
Then using the matcher method on the patterns class to get the found data.
Name _______________________________
Assume
Example is below:
String subject = . . .
String regex;
String result;
. . .
Pattern pat = Pattern.compile(regex);
Matcher mat = pat.matcher(subject);
while (mat.find()) {
System.out.println(mat.group());
}
Answer the following questions. Regular expressions do not have to be written as Java strings (eg, no Java string escape for the '\').