should the regex really be `^\d+$`?  I.E. Only matches if all the characters are digit, in which case you don't need "g" modifier?