How would I extract the dollar amount from the following string
\"some text will go here and more and more and then there will be some price $34.03 but that doesn\'t
I'm no regex-guru, but was able to whip up the following with RegExr.
/(\$[0-9]+(\.[0-9]{2})?)/
Matches $35.03 and $35. To accept formats like $35,000.52 you would need to include ,
$35.03
$35
$35,000.52
,
/(\$[0-9,]+(\.[0-9]{2})?)/
This could likely be improved upon, but from my preliminary tests, it works just fine.