I have regexp that extracts values between parentheses.
It's working most of the time but not when it ends with a parentheses
var val = 'STR("ABC(t)")';
var regExp = /\(([^)]+)\)/;.
var matches = regExp.exec(val);
    
console.log(matches[1]); //"ABC(t"
What I want is "ABC(t)".
Any ideas how I can modify my regexp to Achive this?
Update The value is always inside the parentheses.
Some examples:
'ASD("123")'; => '123'
'ASD(123)'; => '123'
'ASD(aa(10)asda(459))'; => 'aa(10)asda(459)'
So first there is some text (always text). Then there is a (, and it always ends with a ). I want the value between.

), so your capturing group ends and then you match the)(when it should be the other way around). Voting off-topic because the problem is a typographic error.'some text (num(10a ) ss) STR("ABC(t)")'?/("\w+\(.*?\)")/should work in this case./\((.+)\)/will do. More details about the input are necessary.