CS2121 lab exercise 1 - hints

How do you match "any character"?

Your first guess might be to use "[ ]" and to write out everything that is allowed e.g.

but what about spaces and tabs, or special characters like "-" or "'" etc.. How can you anticipate everything that might be there? There is an alternative trick you can use, if you really want to allow for any character:

You can use "." to mean "any character (except the end-of-line character)" e.g.

would match any line containing at least one character (even a space), but not an empty line containing no characters at all!
If you want to match any character except some list of characters, look here.