I am having following tags, I want to replace class name of p tag which follows h2 tag.
<h2>H2 Tag</h2>
<p class="cn">But you forget</p>
I have tried the following
/* </h2>(.*)<p class="cn"> */
preg_match('/<\/h2>(.*)<p class="cn">/m', $input_line, $output_array);
It's not matching new line