Regexp nitpick: use \A and \Z, plus it could be written just as `/\A\d+-?/