E
Erik Jälevik
I have a regular expression which I believe is correct but it's not behaving
as expected. It is as follows:
/\+?\d+[-\s\d]*\d+/
The idea is that a phone number is allowed to be of the form: optional +
followed by one or more digits followed by any combination of hyphens,
spaces and digits followed by at least one digit.
However, this regexp is letting through all sorts of expressions as long as
they've got two adjacent digits it seems.
Grateful for help!
Thanks,
Erik
as expected. It is as follows:
/\+?\d+[-\s\d]*\d+/
The idea is that a phone number is allowed to be of the form: optional +
followed by one or more digits followed by any combination of hyphens,
spaces and digits followed by at least one digit.
However, this regexp is letting through all sorts of expressions as long as
they've got two adjacent digits it seems.
Grateful for help!
Thanks,
Erik