This replaces our homegrown regexps (that didn't quite work) with ruby built-in regexps, and uses the termination anchor to ensure that the entire string, not just the first part, is validated.