I have a string in my certain columns of my database:
<img title="\frac{3}{8}" src="http://latex.codecogs.com/gif.latex?\dpi{50}&space;\fn_phv&space;\frac{3}{8}" alt="" />
Basically it contains a html code for a fraction. But now I would like to replace it with:
<sup>3</sup>⁄<sub>8</sub>
I know I can update the value in the database as such:
UPDATE table
SET `field` = Replace(`option`, '<img title="\frac{3}{8}" src="http://latex.codecogs.com/gif.latex?\dpi{50}&space;\fn_phv&space;\frac{3}{8}" alt="" />','<sup>3</sup>⁄<sub>8</sub>')
WHERE `filed` LIKE '%<img title="\frac{3}{8}" src="http://latex.codecogs.com/gif.latex?\dpi{50}&space;\fn_phv&space;\frac{3}{8}" alt="" />%'
However, the word "\frac{3}{8}" can change accordingly. The number in the parentheses can change and when it changes I need to change the html tag that will replace to change accordingly as well. I know I need to use regular expressions, but not sure how to do it in SQL.
Need some guidance to do it.