RegularExpressionValidator
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngregexp' list.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.

Rodrigo Tetsuo Aoki
-- Moved from [aspngfreeforall] to [aspngregexp] by Charles M. Carroll <Click here to reveal e-mail address> --Is it possible to make sure that the value is a number when the user isfilling out a form by using RegularExpressionValidator?I'm trying to use it, but I don't know how to build the rightValidationExpression.Or there's another easier way to do it?Thanks in advanced,Rodrigo Tetsuo AokiWeb MasterATITUDE Comunicação DigitalE-Mail: Click here to reveal e-mail address: 55 11 5181-1255
Reply to this message...
 
    
Mark Bruce
some good examples here
http://regexlib.com
Rodrigo Tetsuo Aoki <Click here to reveal e-mail address> wrote: -- Moved from [aspngfreeforall] to [aspngregexp] by Charles M. Carroll --

Is it possible to make sure that the value is a number when the user is
filling out a form by using RegularExpressionValidator?

I'm trying to use it, but I don't know how to build the right
ValidationExpression.

Or there's another easier way to do it?

Thanks in advanced,

Rodrigo Tetsuo Aoki
Web Master
ATITUDE Comunicação Digital
E-Mail: Click here to reveal e-mail address
Phone: 55 11 5181-1255

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

---------------------------------
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail.
Reply to this message...
 
    
Wayne King
Yes, you should be able to use a regex to confirm a value is a number. =
However, if need to confirm the value is an integer, it may be cleaner =
and simpler to use the CompareValidator or the RangeValidator. Both of =
these can do data-type check for integer.

Example:
<asp:CompareValidator runat=3Dserver Type=3DInteger =
Operator=3DDataTypeCheck />

Or:
<asp:RangeValidator runat=3Dserver Type=3DInteger MinimumValue=3D"0" =
MaximumValue=3D"1000" />

Using a regex, the pattern \d will match any single digit. You can =
match a positive number of arbitrary length with \d+
Example:
<asp:RegularExpressionValidator runat=3Dserver =
ValidationExpression=3D"\d+" />

-----Original Message-----
From: Mark Bruce [mailto:Click here to reveal e-mail address]
Sent: Wednesday, January 16, 2002 10:41 AM
To: aspngregexp
Subject: [aspngregexp] Re: RegularExpressionValidator

some good examples here=20
http://regexlib.com =20
Rodrigo Tetsuo Aoki <Click here to reveal e-mail address> wrote:=20

-- Moved from [aspngfreeforall] to [aspngregexp] by Charles M. Carroll =
--

Is it possible to make sure that the value is a number when the user is
filling out a form by using RegularExpressionValidator?

I'm trying to use it, but I don't know how to build the right
ValidationExpression.

Or there's another easier way to do it?

Thanks in advanced,

Rodrigo Tetsuo Aoki
Web Master
ATITUDE Comunica=E7=E3o Digital
E-Mail: Click here to reveal e-mail address
Phone: 55 11 5181-1255

Reply to this message...
 
    
Josh Perry
Check out http://regxlib.com/ it has some common regular expressions you may need to use.

Joshua Perry
1-800 CONTACTS, INC.
Information Systems Developer
(801)924-9828

-----Original Message-----
From: Rodrigo Tetsuo Aoki [mailto:Click here to reveal e-mail address]
Sent: Wednesday, January 16, 2002 12:20 PM
To: aspngregexp
Subject: [aspngregexp] RegularExpressionValidator

-- Moved from [aspngfreeforall] to [aspngregexp] by Charles M. Carroll <Click here to reveal e-mail address> --

Is it possible to make sure that the value is a number when the user is
filling out a form by using RegularExpressionValidator?

I'm trying to use it, but I don't know how to build the right
ValidationExpression.

Or there's another easier way to do it?

Thanks in advanced,

Rodrigo Tetsuo Aoki
Web Master
ATITUDE Comunicação Digital
E-Mail: Click here to reveal e-mail address
Phone: 55 11 5181-1255

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives
Reply to this message...
 
    
Scott Watermasysk (VIP)
Yes it is possible. But you should use the Compare validator. Set Type to
Integer and Operator to DataTypeCheck.

-Scott

-----Original Message-----
From: Mark Bruce [mailto:Click here to reveal e-mail address]
Sent: Wednesday, January 16, 2002 1:41 PM
To: aspngregexp
Subject: [aspngregexp] Re: RegularExpressionValidator

some good examples here

http://regexlib.com

Rodrigo Tetsuo Aoki <Click here to reveal e-mail address> wrote:

-- Moved from [aspngfreeforall] to [aspngregexp] by Charles M. Carroll --

Is it possible to make sure that the value is a number when the user is
filling out a form by using RegularExpressionValidator?

I'm trying to use it, but I don't know how to build the right
ValidationExpression.

Or there's another easier way to do it?

Thanks in advanced,

Rodrigo Tetsuo Aoki
Web Master
ATITUDE Comunicação Digital
E-Mail: Click here to reveal e-mail address
Phone: 55 11 5181-1255

| [aspngregexp] member Click here to reveal e-mail address = YOUR ID
| http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT
| http://www.asplists.com/search = SEARCH Archives

_____

Do You Yahoo!?
Send FREE video
<http://rd.yahoo.com/mail_us/tag/?http://promo.yahoo.com/videomail/> emails
in Yahoo! <http://rd.yahoo.com/mail_us/tag/?http://mail.yahoo.com/> Mail. |
[aspngregexp] member Click here to reveal e-mail address = YOUR ID |
http://www.asplists.com/asplists/aspngregexp.asp = JOIN/QUIT |
http://www.asplists.com/search = SEARCH Archives
Reply to this message...
 
 
System.Web.UI.MobileControls.CompareValidator
System.Web.UI.MobileControls.RangeValidator
System.Web.UI.MobileControls.RegularExpressionValidator
System.Web.UI.WebControls.CompareValidator
System.Web.UI.WebControls.RangeValidator
System.Web.UI.WebControls.RegularExpressionValidator




Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
 
 Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us - Terms of Use - Privacy Policy - www.dotnet247.com