Filtering in a text file in Linux using regex

Question:
Filter out the lines that contain any word that starts with a capital letter and are then followed by exactly two lowercase letters in /etc/nsswitch.conf file and save the output in /home/bob/filtered1 file

Answer:

egrep -w '[A-Z][a-z]{2}' /etc/nsswitch.conf > /home/bob/filtered1