Regex Tester Homework

Please use the regex tester at   http://www.zytrax.com/tech/web/regex.htm . Search for "If you plan to experiment with the target strings" and then scroll down one screen to see the String, Re and Results box. Set up your String text cases and your Re regular expression and then click search to see the results box fill.

For homework, please make 5 good regex expressions that test the use of repitition characters * + ?, repetition counts { }, Grouping (), Backreference \1 or \2, Alternators |, Anchors ^ $ , and sets [ ] . Also experiment with ^ inside and outside a set [ ].

A good test will have items that should be matched and ones that should not be matched. It should also contain multiple matches inside a line.

When you are done with each of your 5 regex expressions, copy your test data, your expression and your results into a word document.

Use this to help you figure out what each of these characters mean via experimentation. It is helpful to start with a simple atom, perhaps just find all lines with an f in them, and then keep adding more atoms to the regex. As you add more atoms, add more test cases, so you can be sure you are only picking up the ones you want.