I have a string with many fractions like 1/2, 1/4 etc. I want to replace them with their Unicode equivalents.
I realise I could pick them up with
/\s(\d+)\/(\d+)\s/
How would I replace them with their Unicode equivalents? I could probably wrap the numbers in span
and do something similar with CSS, but I was wondering if there was an easy way to convert them.
Do I need to have a 1:1 mapping of regex to Unicode character?
Thanks