Regex
-
Hi Guys, I have three Regex and would like to know if it's possible to combine them into one. I'm validating phone numbers in the form: - 0219081234 - 021 908 1234 - 021-908-1234 here are my regex for the above in order: - var phoneRegex1 = /^(\d{3})(\d{3})(\d{4})$/; - var phoneRegex2 = /^(\d{3})(\-)(\d{3})(\-)(\d{4})$/; - var phoneRegex3 = /^(\d{3})(\ )(\d{3})(\ )(\d{4})$/; Thanks in Advance, Morgs
-
Hi Guys, I have three Regex and would like to know if it's possible to combine them into one. I'm validating phone numbers in the form: - 0219081234 - 021 908 1234 - 021-908-1234 here are my regex for the above in order: - var phoneRegex1 = /^(\d{3})(\d{3})(\d{4})$/; - var phoneRegex2 = /^(\d{3})(\-)(\d{3})(\-)(\d{4})$/; - var phoneRegex3 = /^(\d{3})(\ )(\d{3})(\ )(\d{4})$/; Thanks in Advance, Morgs
You should really consider asking this in the Regular Expressions forum. We have a dedicated forum for regexes.
Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
-
You should really consider asking this in the Regular Expressions forum. We have a dedicated forum for regexes.
Forgive your enemies - it messes with their heads
My blog | My articles | MoXAML PowerToys | Mole 2010 - debugging made easier - my favourite utility
Thanks