Don't return regexps, use affirmative predicate tests

Change routines that were returning regular expressions that client
code then needed to Do The Right Thing with into predicates that test
whether a thing is valid or not.  (Based on Ricardo's feedback).