Hi
I am creating a regex so that the variable telephone is a the value read in from a html form. I want to delete any white space which i think i have done and make sure there are eleven digits - while the script works for checking ranges 0-11 if the user enters fourteen numbers the prompt valid number appears
Any ideas
($telephone1 = $telephone) =~ s/\s+//g;
if ($telephone1=~m/\d{11}/){print "$telephone is a valid option<br>";}
else {print "$telephone is an invalid number<br>";}
I am creating a regex so that the variable telephone is a the value read in from a html form. I want to delete any white space which i think i have done and make sure there are eleven digits - while the script works for checking ranges 0-11 if the user enters fourteen numbers the prompt valid number appears
Any ideas
($telephone1 = $telephone) =~ s/\s+//g;
if ($telephone1=~m/\d{11}/){print "$telephone is a valid option<br>";}
else {print "$telephone is an invalid number<br>";}