using regex to test for exponents, rendering exponents with native html rather than MathJax