Anchor token RegExps to front of substring; improve input validation