2020-08-26

JavaScript - Return the string between the first found set of parentheses

let regExp = /\(([^)]+)\)/;

let matches = regExp.exec('Show (this) and not (that).');

console.log(matches[1]);


No comments:

Post a Comment