I m trying to create a regex with a string of numbers and special characters in which, if there is a % then the number before and after the % will be replaced by "(" & ")".
Ex.
case 1:
var str = "1*2/9%";
will give me "1*2/(9%)"
case 2:
var str = "1*2/9%8%7";
will give me "1*2/((9%)8%)7"
Please help me with this regex. Thanks in advance.