XEDOX.DE - Regular Expressions mit Maskierung

Regular Expressions

The only thing you are missing is a delimiter in your regexp pattern. I believe this can be any character; a common choice is a forward slash. But then of course you must escape your existing forward slashes. Here are two examples, using forward slash and right square bracket.

$text = preg_replace('/
/', '
', nl2br($text), 1);
$text = preg_replace(']
]', '
', nl2br($text), 1);

Edit Content

Navigation (OliveCMS 1.4 (01.01.2024, PHP8.2) Suche Upload