Hints for exercise 2
General hints about regular expressions:
- Choice:
| and [ ]
and [^]
and .
- Start and end of line:
^
and $
- Repetition:
* and +
- Building up arbitrarily complicated regular expressions:
( )
- Using special characters to just mean themselves:
\ "
and [^-] inside [ ]
Specific problems you might encounter: