Home All Groups Group Topic Archive Search About
Author
28 Nov 2007 5:42 PM
Masterx81
Hi to all...
I'm new to regex, so sorry for the silly question...
I want to do a client side validation for this string:

[r|ra|tc|tr|t|e|c|a|hpa|lpa|hpe|R|RA|TC|TR|T|E|C|A|HPA|LPA|HPE]/
\d{1,2}

But it passes also if the string is null, how i can prevent this?

I've read that the switch (?i) isn't working on the client js side, so
i've put all case variations, there is a better way to do this?

Really thanks to all!

Author
28 Nov 2007 7:07 PM
Arthur Dent
As far as I know, most validators *will* fail (that is, pass) if the string
is empty.
The only solution I know of, is to use them in conjunction with a
RequiredFieldValidator.

to all: Maybe there is some other way someone could contribute?

Show quoteHide quote
"Masterx81" <enr***@je.net> wrote in message
news:fa523092-22d3-47af-b739-d5b68ac1ffee@d4g2000prg.googlegroups.com...
> Hi to all...
> I'm new to regex, so sorry for the silly question...
> I want to do a client side validation for this string:
>
> [r|ra|tc|tr|t|e|c|a|hpa|lpa|hpe|R|RA|TC|TR|T|E|C|A|HPA|LPA|HPE]/
> \d{1,2}
>
> But it passes also if the string is null, how i can prevent this?
>
> I've read that the switch (?i) isn't working on the client js side, so
> i've put all case variations, there is a better way to do this?
>
> Really thanks to all!