Your regexp looks fine. The only trick is that it will match anywhere in the string, so
a ten digit zip will match with 9 digits. If your string ends you can put $ into your regexp (end of string/line),
otherwise you can match whitespace
I noticed that it would match the first 9 out of 10. I'm trying to make it as flexible as possible to make a module for work. I suppose I should just add a \W+$ at the end of it.