This activity accompanies the first case study in Unit 11, on regular expressions.
For this activity we want you to amend the program presented in Unit 11, so that as well as displaying on each row of the HTML table the URL and the pattern that is to be matched for, it will also display the substring that was matched.
For example, if the pattern H[a-z]+y was searched for in the string ))9oiHaadssyopp, then the table would also display the substring Haadssy.
To do this requires the use of the getParen method with an argument 0. For example, if searchPattern is an RE object, the statement:
String matched = searchPattern.getParen(0);
returns the substring that has been found.
1. If the regular expression classes are not found you will need to import the jar file containing the regular expression classes:
jakarta-regexp-1.4.jar
All the classes that you need will then be made available to your project.
2. Before attempting to complete the exercise, run the original program just to check that it works with your firewall configuration. The program requires you to be online to access the web pages listed in the U11CaseStudyProps.txt file.