I need match the 4 pattern
in equation like this type's
_{num}
_num
^{num}
^num
So i was created the regex pattern like this
/\_(\d+)|\^(\d{1})|\_\{(\d+)\}|\^\{(\d+)\}/g
This regex demo working perfect match but apply with javascript code its not working
var int_reg =/\_(\d+)|\^(\d{1})|\_\{(\d+)\}|\^\{(\d+)\}/g;
var str = int_reg.exec('\int_5^{3}100x-100=10');
console.log(str)
Please Tell me what's the problem?.And correct my code with my goal
Thank's