Forum Discussion
hooleylist
Jun 12, 2012Cirrostratus
Yes, I wasn't too concerned about a URI containing non-ascii characters as HTTP URIs must contain only printable ASCII characters (and/or percent encodings of reserved characters). Here are a couple of references:
http://en.wikipedia.org/wiki/Internationalized_domain_name
http://stackoverflow.com/questions/2504564/can-http-uris-have-non-ascii-characters
If you did need to match only 6 0-9 characters you could use [string is numeric $chars] as 'is numeric' returns true for 999999. It wouldn't work once you surpass the limit for an integer (I think this is possibly version and platform specific). Or you could use [string is double $chars] if you want to allow decimal values as well. Or if you want to be more explicit on your matching, you could go back to a regex like [0-9]{6} to match exactly six digits or [0-9]{1,6} to match 1 to 6 digits.
Aaron