Maybe this post discussed previously should help you solve your issue of restricting the numbers while entering data:
Additionally you should also be able to learn more by going through our support article Restricting Text Responses With Regular Expressions which has a lot of practical examples.