regular expressions

  • Thread starter Thread starter Mike P
  • Start date Start date
M

Mike P

Can anybody tell me why this regular expression is not being accepted in
my code?

^0\d{2}\d{0,13}$

Basically, it is meant to start with a 0, and have a minimum of 3 digits
and a maximum of 16.


Any help would be really appreciated.


Cheers,

Mike
 
Mike,

If you're attaching this to a validator remove the "^" and "$" from the
beginning and end. Those are needed when assigning a regular expression to
some objects and not for others. (Confusing, yes?)

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

Free code library at:
www.aboutfortunate.com

"Out of chaos comes order."
Nietzche
 
I got around this by replacing the all \d with [0-9], because the error
I was getting was regarding escape characters.


Thanks,

Mike
 
Back
Top