My string is:'input type="hidden" value="5999" id="productPrice"'
I want to extract value from this string. Please help me to write regex for this.
My string is:'input type="hidden" value="5999" id="productPrice"'
I want to extract value from this string. Please help me to write regex for this.
var string = '<input type="hidden" value="5999" id="productPrice">';
var regex = /<input type="hidden" value="([^"]+)" id="productPrice"/gi;
var price = regex.exec(string);
console.log(price[1]);
price[1];