CS2121 lab exercise 1 - hint

To find all the words containing a decimal digit i.e.
find all the words containing a "0" or "1" or "2" or "3" or "4" or "5" or "6" or "7" or "8" or "9"

You could use "|", which means "or":

0|1|2|3|4|5|6|7|8|9
but as each of the alternatives is just a single character, there is a simpler way to write the same pattern:

You can use "[ ]" to mean "any character from this list" e.g.

[qwerty]
would match (any line containing) either a "q" or a "w" or an "e" or an "r" or a "t" or a "y"

You can simplify things even more by using "-" to mean a range of characters e.g.

[a-e]
is shorthand for
[abcde]

If you want to use "[", "]", "-" or "^" in your list, look here

If you want to recognise any character (except newline), look here.