Suppose I have this HTML in a string:
<meta http-equiv="Set-Cookie" content="COOKIE1_VALUE_HERE">
<meta http-equiv="Set-Cookie" content="COOKIE2_VALUE_HERE">
<meta http-equiv="Set-Cookie" content="COOKIE3_VALUE_HERE">
And I have this regular expression, to get the values inside the content
attributes:
/<meta http-equiv=[\"']?set-cookie[\"']? content=[\"'](.*)[\"'].*>/ig
How do I, in JavaScript, get all three content
values?
I've tried:
var setCookieMetaRegExp = /<meta http-equiv=[\"']?set-cookie[\"']? content=[\"'](.*)[\"'].*>/ig;
var match = setCookieMetaRegExp.exec(htmlstring);
but match
doesn't contain the values I need. Help?
Note: the regular expression is already correct (see here). I just need to match it to the string. Note: I'm using NodeJS