I am still a newbie in regular expression, please help me out guys.
I have this html file, some of the paragraphs contains dollar values ($200, $300 etc). Whenever a user visits that file it will convert those values into their own currency.
I want to use regular expression to look for those values and have proper conversion.
Thanks in advance!
Here is a working example with few assumptions. I believe you have the conversion factor and you can substitute the actual value with the conversion factor.
Edit: modified to allow conversion only for the matching numerical values. Numerical values are assumed to be positive integer values.
Fiddle here http://jsfiddle.net/gbsandeep/eBQFE/
Example:
Converted from currency “$” to hypothetical currency with symbol “@”
Conversion factor: 0.05
Input
Output