Activity 11.1 - Trying out some regular expressions

Please note that all of the Unit 11 and Unit 12 Activities are optional.

Topic

This activity accompanies the first case study in Unit 11, on regular expressions.

Instructions

For this activity we have provided you with a class containing a single main method. In the main method is code which allows you to search a specified string (toBeSearchedIn) for a particular regular expression (rExpr). If a match is found then an 'expression matched' message will be displayed on System.out; if not, then an 'expression not matched' message will be displayed. Try it out and experiment with a number of strings and regular expressions.

Notes

If the regular expression classes are not found, you will need to import the jar file containing the regular expression classes:

All the classes that you need will then be made available to your project.