Fix the regex so bad hostnames don't blow up

This came up on the first public delivery because someone used the name
of '$studentname-master'
Merge pull request #317 from binford2k/fix/poor_regex_wizardry

Fix the regex so bad hostnames don't blow up