Regular Expression Validator for ASP.NET
Messages   Related Types
This message was discovered on ASPFriends.com 'aspngregexp' list.


Ian Vink
-- Moved from [aspngreuse] to [aspngregexp] by Ryan Trudelle-Schwarz <Click here to reveal e-mail address> --

What would the expression be for a decimal value that could accept:

123.12
123.1
123
12
1

(An number of numbers to the left of the decimal, max of two to the =
right)

Reply to this message...
 
    
Ryan Trudelle-Schwarz
\d+\(.\d{1,2})?

Should do it for you I think.

Hth, Ryan

-> -----Original Message-----
-> From: Ian Vink [mailto:Click here to reveal e-mail address]
->
-> What would the expression be for a decimal value that could accept:
->
-> 123.12
-> 123.1
-> 123
-> 12
-> 1
->
-> (An number of numbers to the left of the decimal, max of two to the =
-> right)

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
    
Wayne King (ASP.NET)
I think you swapped the open-paren and backslash; try this instead:

\d+(\.\d{1,2})?

-----Original Message-----
From: Ryan Trudelle-Schwarz [mailto:Click here to reveal e-mail address]=20

\d+\(.\d{1,2})?

Should do it for you I think.

Hth, Ryan

-> -----Original Message-----
-> From: Ian Vink [mailto:Click here to reveal e-mail address]
->=20
-> What would the expression be for a decimal value that could accept:
->=20
-> 123.12
-> 123.1
-> 123
-> 12
-> 1
->=20
-> (An number of numbers to the left of the decimal, max of two to the =
=3D
-> right)

Reply to this message...
 
    
Ryan Trudelle-Schwarz
Oops, thanks.

-> -----Original Message-----
-> From: Wayne King (ASP.NET) [mailto:Click here to reveal e-mail address]
->
-> I think you swapped the open-paren and backslash; try this instead:
->
-> \d+(\.\d{1,2})?
->
->
-> -----Original Message-----
-> From: Ryan Trudelle-Schwarz [mailto:Click here to reveal e-mail address]
->
-> \d+\(.\d{1,2})?
->
-> Should do it for you I think.
->
-> Hth, Ryan
->
-> -> -----Original Message-----
-> -> From: Ian Vink [mailto:Click here to reveal e-mail address]
-> ->
-> -> What would the expression be for a decimal value that could
accept:
-> ->
-> -> 123.12
-> -> 123.1
-> -> 123
-> -> 12
-> -> 1
-> ->
-> -> (An number of numbers to the left of the decimal, max of two to
the =
-> -> right)

---
[This E-mail scanned for viruses by Declude Virus]

Reply to this message...
 
 




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