There are a lot of questions on SO re: matching within a brackets, parens, etc but I'm wondering how to match within a character (parens) while ignoring that character
"Key (email)=(basil@gmail.com) already exists".match(/\(([^)]+)\)/g)
// => ["(email)", "(basil@gmail.com)"]
I believe this is because JS doesn't support [^)]
. Given that, how would you recommend extracting the values within the parens.
I'd prefer something less hacky than having to call .replace('(', '').replace(')', '')
on the values
I'd like the return value to be ["email", "basil@gmail.com"]