Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi all,

I'm trying to fill out an online form and need to fill in my phone number (US format I presume).

It didn't work, so I looked at its validation code. It's a regex and the code is:

^[0-9]{5-15}$

Here it is again, now put in context:

HTML



What can I fill in so that I can move past this form? (Only numbes are accepted, leaving it blank doesn't work either.)

Thanks!

Petter

What I have tried:

I have tried numerous variants at regexlib.com but can't find something that works. Things I've tried: blank, 1, 111111111, (301)-123-1234
Posted
Updated 27-Sep-16 5:51am

Hope it help.
Here is a link to RegEx documentation:
perlre - perldoc.perl.org[^]
Here is links to tools to help build RegEx and debug them:
.NET Regex Tester - Regex Storm[^]
Expresso Regular Expression Tool[^]

This one show you the RegEx as a nice graph which is really helpful to understand what is doing a RegEx:
Debuggex: Online visual regex tester. JavaScript, Python, and PCRE.[^]
 
Share this answer
 
If you would like to check if phone number is US format, take a look at this: javascript - Regular expression to validate US phone numbers? - Stack Overflow[^]
 
Share this answer
 
It's not a valid regex for a telephone number: what it matches is literally a single numeric digit followed by the text "{5-15}" and nothing else.

What they probably meant to say was:
C#
^[0-9]{5,15}$

Which matches "any string of numeric digits between 5 and 15 characters long, inclusive."

To be honest, if that's the quality of their regex testing, I wouldn't give any personal information to them, and definitely nothing that contained a credit card number.
 
Share this answer
 
Comments
petter2012 27-Sep-16 9:44am    
Thanks a lot. Didn't recall that a comma was necessary. Actually I used this form to get in touch with the patenting department at Google. Guess they don't want new ideas from outside the company. :)
OriginalGriff 27-Sep-16 9:55am    
That...says a lot... :sigh:

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900