Hi guys
I'm really bad at regexp.. i've been at this for some time already can't seem to get it right..
anyway im creating a small script that detects dollar amounts in a body of text and appends next to it its corresponding value..
EXAMPLE INPUT:
Cables Unlimited $5.21
Gold Plated HDMI $4.99 (delivered)
3pcs of Mini Adaptor $5.55
the resulting text output would be
Cables Unlimited $5.21 (234.45)
Gold Plated HDMI $4.99 (224.55) (delivered)
3pcs of Mini Adaptor $5.55 (249.75)
As you can see above the amount in dollars have its coresponding forex conversion to local currency using 45 is to 1 USD..
i can probably figure out how to process and append the values (str_replace? explode() function?, etc).. but my real problem is coming up w/ the regexp for detecting the dollar amounts..
A regexp that would return the text beginning (not inclusive of) the "$" sign up to the first space it detects would be perfect..
would really appreciate help.. thanks so much!