Run the three worked-example patterns over the candidate file
Run the three worked-example patterns over the candidate file
Answer
grep -E 'a|bc*' candidates grep -E '(a|b)*' candidates grep 'L..e' candidates
The first prints every line containing an a, or a b with any number of trailing c characters. The second prints all six lines, because zero repetitions is a legal match and every line contains the empty string. The third needs a literal L, exactly two characters, then a literal e.
Sarwar & Koretsky 3e ch7 §7.5; POSIX.1-2024 XBD §9 (BRE and ERE)