I noticed that fgrep disagreed with the regex code as well, so while I'm in the neighborhood I applied the attached patch.