RegExLib.com - The first Regular Expression Library on the Web!

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(\$)?(\s)?(\-)?((\d+)|(\d{1,3})(\,\d{3})*)(\.\d{2,})?$
Description
Allows either inclusion of $ symbol or not. Allows a whitespace character after the $ sysmbol or not. Allows a negative symbol in front of the starting digit or not. Allows comma separators at thousands, but nowhere else. Allows more than two decimal places.
Matches
$1,000.00 | $-1,000.00 | 100.8766
Non-Matches
$1a | $#100.00 | 1,00.00
Author Rating: Not yet rated. Ron Allen
Source modified from an expression by Matt Wickless
Your Rating
Bad Good

Enter New Comment

Title

Name

Comment

Spammers suck - we apologize. Please enter the text shown below to enable your comment (not case sensitive - try as many times as you need to if the first ones are too hard):

Existing User Comments

Title: Handy for numerics in gridviews and textboxes
Name: Rob Drake
Date: 3/20/2007 8:28:20 AM
Comment:
Ron, very cool. I use this in objects as above. Good addition would be to allow for something like (99.95) where the -ve is okay as well as the ()


Copyright © 2001-2024, RegexAdvice.com | ASP.NET Tutorials