|
|
Browse by Tags
All Tags » javascript » bash
-
Hi,
I need a regular expression to replace the caret ^ character with Math.pow, some examples of what I need:
2^3 -> Math.pow(2,3)
5*2^32+1 -> 5*Math.pow(2,32)+1
2*(3+1)^(8+(2+3)*2)+99 -> 2*Math.pow((3+1),(8+(2+3)*2))+99
2^3^4+1 -> Math.pow(2,Math.pow(3,4))+1
I think this is quite a challenge ...
|
|
|