Answers for "get value from within parentheses of a string javascript"

2

get value from within parentheses of a string javascript

var regExp = /\(([^)]+)\)/;
var matches = regExp.exec("I expect five hundred dollars ($500).");

//matches[1] contains the value between the parentheses
console.log(matches[1]);
Posted by: Guest on April-23-2021

Code answers related to "get value from within parentheses of a string javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language