I want extract an Id from the string <p>id = 22<p>\n<p>1. iteration, 1. task<p>
with:
var str="<p>id = 22<p>\n<p>1. iteration, 1. task<p>";
var patt1=/<p>id = (.*)<p>/;
document.write(str.match(patt1));
but somehow it returns to the browser:
id = 22
,22
Why so? Why 2 matches?