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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Pattern Title
Expression
^(\$\ |\$)?((0|00|[1-9]\d*|([1-9]\d{0,2}(\,\d{3})*))(\.\d{1,4})?|(\.\d{1,4}))$
Description
Allows for a dollar sign with no space after, a dollar sign with a space after, and no dollar sign. Also makes sure theres no more than 4 decimal places. Takes out leading zeros if the number isn't 0, and protects against blank entries.
Matches
$ 123.4 | $00.5 | 200,000
Non-Matches
$012,234.44 | -39.05 | $45,23,330.00
Author Rating: Not yet rated. Corey Charlton
Source
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

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