Single character
# One 'a'
grep -P 'a' filename
# One or more 'a'
grep -P 'a+' filename
# Zero or more 'a'
grep -P 'a*' filename
# Zero or one 'a'
grep -P 'a?' filename
# Three 'a'
grep -P 'a{3}' filename
# Between one and three 'a'
grep -P 'a{1,3}' filename
# Begins with a
grep -P '^a' filename
# Ends with a
grep -P 'a$' filename
Word
grep -P 'cat' filename
# Wildcard in the middle
grep -P 'c.t' filename
# Multiple words (cat, cot, cut)
grep -P 'c[aou]t' filename
# ab or cd
grep -P 'ab|cd' filename
Special patterns
\s looks for a space character (could be space or tab).
\S looks for a non-space character.
\d looks for a number.
\D looks for a non-number.
\w looks for an alphabet.
\W looks for a non-alphabet.
\b looks for word-boundary
\B looks for non-word boundary.
Sandboxes and References
http://regexr.com/
https://regex101.com/