Home |

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);
Last Change: 04/10/17 15:49 | Help | Recent Changes | Edit Page |
| OliveWiki 3.10 (17.04.2019, 07.49 PHP7.2)