I'm trying to build a regex to validate a street address, so I need to allow letters,
numbers, as well as ".", "-", and single quote " ' ". I need to check for this patter
separated by white space, such as 122 Some Street
Here is my attempt:
ereg('([a-zA-Z.0-9-\']+\s{0,1})([a-zA-Z.0-9-\']+\s{0,1})+',$data)
I get this
Warning: REG_ERANGE: in e:\inetpub\classes\validate.inc on line 39
- Is there a simpler way
- If I remove the \' and -, it works, or at least I don't get an error.
Please help.
Thanks,
Brian