I have a standard email which I am looking to extract certain details from.
Amongst the email are lines like so:
<strong>Name:</strong> John Smith
So to simulate this I have the following JavaScript:
var str = "<br><strong>Name:</strong> John Smith<br>";
var re = /\<strong>Name\s*:\<\/strong>\s*([^\<]*)/g
match = re.exec(str);
while (match != null) {
console.log(match[0]);
match = re.exec(str);
}
This only comes out with one result, which is:
<strong>Name:</strong> John Smith
I was hoping to get the capture group ([^\<]*)
which in this example would be John Smith
What am I missing here?