I need to use an html pattern to validate phone numbers that can include numbers between 0-9 and can include . and - characters but the real issue is that I have to limit the special character so that they don't repeat. I believe that the solution to this is negative lookahead but I am not able to use it.
Asked
Active
Viewed 9 times
0
-
I was finally able to do it... ^[0-9](?!.*[^0-9.-])(?!.*[.-]{2}).+[0-9]$ this is the pattern for such tasks – user9311696 May 29 '20 at 06:30