Hi
I'm trying to validate a mobile phone number in the following forms with a regexp (the field is a textfield):
012-345 67 89 or 0123-45 67 89
Iv'e search internet (googled) and had a lot of result but none that worked for me.
Iv'e searched this forum but with no luck in the two ways.
My experience with regexp (and coding) is 0 so it took some hevily reading before I finally came up with this:
Code:
/^\d{3}-\d{3} \d{2} \d{2}$/
And this validated the first mobile number (great) but not the second one.
So I change the code to this:
Code:
/^\d{3,4}-\d{2,3} \d{2} \d{2}$/
So I'm getting closer, now this validates the first mobile number and the second mobile number unfortunatly it also validates a mobile phone number as correct in the followig way:
012-34 56 78 (which is wrong) and also 0123-456 78 90 (which is also wrong).
How should a change the above regexp so that it only validates in my two cases?
Is there anyone that please could help me out with this.
Regards
Stephen