Rather than doing this regex match here, maybe we should just change the `.to_i` below to use `Integer`, and then rescue the error and deal with it?  That seems more robust than the regex match to me.