.NETGURU
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




ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
Ad


Need Dot Net Interview Questions?
Ask ExamGuru, Inc. for advice and help on Passing .Net Interviews
.Net Projects
Best-of-breed application framework for .NET projects, developed by ExamGuru, Inc. and ExamGuru IT
Free .net Help
Commission ExamGuru, Inc. and his team for your next bespoke software project
FogBUGZ
The only bug tracking system carefully crafted with one goal in mind: helping teams create great software.
Awesome Tools
If you don't know about these, you're missing out... IT Certification Questions
IT Interview Questions
Free Oracle 10g Training
MCSE Boortcamp
Cisco Study Guides
Cheap Study Guides
Exact Questions
Dot Net Interview Questions
Oracle OCP
Cheap Travel
Designer Perfumes - Wholesale Prices
Free Programming Tutorials
 
ExamGuru IT Solutions - .Net Guru is owned and operated by ExamGuru, Inc., the man behind .Net Guru. If you're in the market for bespoke software or software consultancy, why not get him and his highly trained team to help? - www.examguru.net/ITCertification
 Copyright © ExamGuru, Inc. 2001-2006
Contact Us - Terms of Use - Privacy Policy - www.dot-net-guru.com - www.examguru.net - www.oraclesource.net - www.itinterviews.net - www.examguru.net/ITCertification