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
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
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.