• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 133
  • Last Modified:

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 $
0
Charles Baldo
Asked:
Charles Baldo
1 Solution
 
Rgonzo1971Commented:
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now