Below is the code
var str = '<p>first occurrence</p> can have multiple lines of ln or new line code etc <p>another p</p> and then again <p>another code in p </p>';
expected result with regex or simple jquery:
first occurrence can have multiple lines of ln or new line code etc <p>another p</p> and then again <p>another code in p </p>