Comments below showed me that there was a functionality bug in my code. The question was updated to match.
So I have a regex that finds bb style quote and replaces them with a blockquote.
$text = preg_replace("/\[quote(?:=\"(\w+?)\")?]/", '<blockquote class="quote"><div class="quotee">\1 says:</div>', $text);
$text = preg_replace("/\[\/quote\]/m", '</blockquote>', $text);
It works just fine (its in a while loop to get recursive quotes), but later on, I use nl2br. However, I don't want to add a br after the blockquote, so I want to remove the newline right after the pattern, but nothing I've done has worked.
I've tried:
/\[\/quote\][\r\n]?/ms
/\[\/quote\][\r\n]*/ms
/\[\/quote\][\r\n]{0,2}/ms
/\[\/quote\](?:[\r\n]|\r\n)?/ms
Any advice?