Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > ValidationExpression

Reply
Thread Tools

ValidationExpression

 
 
metridevkk
Guest
Posts: n/a
 
      12-03-2004
Hi,
I have attached a RegularExpressionValidator Control to a textbox to accept
numeric values in the format:

###*#####*##

I have entered the following regex in the ValidationExpression:

[0-9]{3}\*[0-9]{5}\*[0-9]{2}
or
[0-9]{3}[\*][0-9]{5}[\*][0-9]{2}

but validator fails to validate an input such as:

111*11111*11

Could someone please guide me on what is wrong in the regular expression
that i have specified?

Thanks.

 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      12-03-2004
\d{3}*\d{5}*\d{2}


"metridevkk" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Hi,
> I have attached a RegularExpressionValidator Control to a textbox to
> accept
> numeric values in the format:
>
> ###*#####*##
>
> I have entered the following regex in the ValidationExpression:
>
> [0-9]{3}\*[0-9]{5}\*[0-9]{2}
> or
> [0-9]{3}[\*][0-9]{5}[\*][0-9]{2}
>
> but validator fails to validate an input such as:
>
> 111*11111*11
>
> Could someone please guide me on what is wrong in the regular expression
> that i have specified?
>
> Thanks.
>



 
Reply With Quote
 
 
 
 
metridevkk
Guest
Posts: n/a
 
      12-03-2004
Interestingly, my expression:

[0-9]{3}\*[0-9]{5}\*[0-9]{2}

worked on another machine. But on my machine it does not validate the input
in the browser. Vey wierd.

I tried your expression on my machine, but the validator(at design time)
wouldn't accept & said "Invalid property value: \d{3}*\d{5}*\d{2} is not a
valid regular expression". Mayme it will work on the other machine. If so,
then something wrong on my machine only.

Thanks



"Scott M." wrote:

> \d{3}*\d{5}*\d{2}
>
>
> "metridevkk" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> > Hi,
> > I have attached a RegularExpressionValidator Control to a textbox to
> > accept
> > numeric values in the format:
> >
> > ###*#####*##
> >
> > I have entered the following regex in the ValidationExpression:
> >
> > [0-9]{3}\*[0-9]{5}\*[0-9]{2}
> > or
> > [0-9]{3}[\*][0-9]{5}[\*][0-9]{2}
> >
> > but validator fails to validate an input such as:
> >
> > 111*11111*11
> >
> > Could someone please guide me on what is wrong in the regular expression
> > that i have specified?
> >
> > Thanks.
> >

>
>
>

 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      12-04-2004
Sorry about that. The asterisk char needs to be escaped because it is a
reserved char. This works:

\d{3}\*\d{5}\*\d{2}


"metridevkk" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Interestingly, my expression:
>
> [0-9]{3}\*[0-9]{5}\*[0-9]{2}
>
> worked on another machine. But on my machine it does not validate the
> input
> in the browser. Vey wierd.
>
> I tried your expression on my machine, but the validator(at design time)
> wouldn't accept & said "Invalid property value: \d{3}*\d{5}*\d{2} is not a
> valid regular expression". Mayme it will work on the other machine. If so,
> then something wrong on my machine only.
>
> Thanks
>
>
>
> "Scott M." wrote:
>
>> \d{3}*\d{5}*\d{2}
>>
>>
>> "metridevkk" <(E-Mail Removed)> wrote in message
>> news:(E-Mail Removed)...
>> > Hi,
>> > I have attached a RegularExpressionValidator Control to a textbox to
>> > accept
>> > numeric values in the format:
>> >
>> > ###*#####*##
>> >
>> > I have entered the following regex in the ValidationExpression:
>> >
>> > [0-9]{3}\*[0-9]{5}\*[0-9]{2}
>> > or
>> > [0-9]{3}[\*][0-9]{5}[\*][0-9]{2}
>> >
>> > but validator fails to validate an input such as:
>> >
>> > 111*11111*11
>> >
>> > Could someone please guide me on what is wrong in the regular
>> > expression
>> > that i have specified?
>> >
>> > Thanks.
>> >

>>
>>
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ValidationExpression that simulates the MaxLength property Nathan Sokalski ASP .Net 2 01-03-2007 07:30 AM
ValidationExpression Error skardian@gmail.com ASP .Net 3 11-17-2006 08:55 PM
ValidationExpression for a single number TD ASP .Net 3 11-30-2005 11:32 AM
ValidationExpression =?Utf-8?B?SklNLkgu?= ASP .Net 4 11-18-2004 05:45 PM
ValidationExpression Syntax =?Utf-8?B?T2xpdmVyIFNjaHVsemU=?= ASP .Net 0 05-12-2004 02:06 PM



Advertisments