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
What about this regexp: \$[0-9.,]+ or \$([0-9.,]+) to strip the $?
It's simple but it does pretty much what you want, it even catches things like this: $1,450.8934 or $14.343.
Of course the drawback it'd be that it'd catch $34.54.23 as well.
Or if you want to catch only two decimals: \$[0-9,]+\.[0-9]{2} it'd catch the $5.23 part of $5.234565.
You can use it with preg_match or preg_match_all.