2020-08-26

JavaScript - Return the string between the first found set of curly brackets

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

let matches = regExp.exec('Now show {this}, and not (that).');

console.log(matches[1]);

No comments:

Post a Comment