in reply to Re^3: Replace newlines only if not inside braces
in thread Replace newlines only if not inside braces
$data =~ s<(?:{{.*?}}|[^\n])*\K\n>{<br>\n}gs;
I think (didn't test it) that the * is two greedy, better *?.
Cheers Rolf
In Section
Seekers of Perl Wisdom