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

Please support RegExLib Sponsors

Sponsors

Regular Expression Details

Title Test Find Currency - Money
Expression
^(-?\$?([1-9]\d{0,2}(,\d{3})*|[1-9]\d*|0|)(.\d{1,2})?|\(\$?([1-9]\d{0,2}(,\d{3})*|[1-9]\d*|0|)(.\d{1,2})?\))$
Description
Handles any kind of money entry. With $ sign or not, with commas or not. With bracket, negative sign or none. Max of 2 decimal points. It's perfect :)
Matches
112.12 $1,112.15 (15555.5) $.12 0.1
Non-Matches
$111,1.15 52.121 (123.12 s123
Author Rating: The rating for this expression. Salam Abbas
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

Title: Whoops
Name: Michael Jordan
Date: 5/26/2020 4:50:49 AM
Comment:
(12 parses as a valid value. I don't believe that's a valid entry.


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