MeridianManagement
asked on
Need to update regular expression in PHP
I have a preg_replace that removes monetary values from a website. Unfortunately, it doesn't pick up negative monetary numbers such as $-51.00. Just a small tweak but I don't know how to do it.
$html = preg_replace('/\$[0-9]+\.[ 0-9]{2}/', "",$html);
$html = preg_replace('/\$[0-9]+\.[
preg_replace('/\$(-)?[0-9] +\.[0-9]{2 }/',"",$ht ml);
ASKER
Thanks Mason, you're always so quick
ASKER CERTIFIED SOLUTION
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
ASKER
I haven't checked but I trust your solution is correct.
If you have any problems, just ask in the continuing discussion window and I'll stick around until you've got it. But I really don't think you will. That's the expression for the problem you described.