You have to write it like:
egrep "^w.*\.pdf$" filename
- Means started with
w followed by any character and ended to .pdf.
for a logical "or" you can use -e switch:
egrep -e pattern1 -e pattern2
means all lines with pattern1 or pattern2.
or as @steeldriver suggested, use extended regex "or":
egrep "(pattern1|pattern2)"
and as you know for extended regular expressions you have to use egrep and not grep, e.g:
egrep '(bbb|ccc)' # works fine for your file
grep '(bbb|ccc)' # doens't have any result
For an "and" you have to pipe it to another egrep:
grep pattern1 | grep pattern2
means all lines with both pattern1 and pattern2.
or use another tools like awk:
awk '/pattern1/ && /pattern2/` filename