Add regular expression grammar

In addition to the BNF grammar, provide regular expressions for use in
tokenizing and validating SemVer strings.

Note that this builds on the BNF grammar provided in f31c422.  It should be possible to cherry-pick this without taking BNF, but since the BNF seems less controversial, I opted to avoid the conflicts in the event that this was acceptable as well.