Need Regex Money No $

Please I need a reg ex that will do Money without the $

numbers only
commas in right place
2 dp
no $
Charles BaldoSoftware DeveloperAsked:
Who is Participating?
 
Rgonzo1971Connect With a Mentor Commented:
Hi,

pls try
(([0-9]{1,3}),?.?\d{0,2})(([0-9]{1,3})?,?.?\d{0,2})?(\.\d{0,2})?

Open in new window

REgards
0
 
Dustin SaundersDirector of OperationsCommented:
If it has a $ on it, then it's a string right?  Why not just use:

string.replace("$",string.Empty)

Open in new window


or
string.Substring(1)

Open in new window

0
 
käµfm³d 👽Commented:
^\d{1,3}(,\d{3})*(\.\d\d)?$

Open in new window


If you don't want the decimal part to be optional, then remove the ?
0
 
Charles BaldoSoftware DeveloperAuthor Commented:
Worked best
0
 
käµfm³d 👽Commented:
I fail to see how considering it allows things like:

1,000,0.00
1
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.