Trying to make a regex that can handle input like either:
- Beverly Hills, CA
- Beverly Hills, CA 90210
I have this:
^(.+)[,\\s]+(.+)\s+(\d{5})?$
It works for the #2 case, but not #1. If I change the \s+ to \s* then it works for #1 but not #2.
You can play around with it here: http://rubular.com/r/oqKBJ4r8cq
Try this:
http://rubular.com/r/qS0e5vAQnT