matches any Unicode newline sequence; can be modified using verbs
$string = preg_replace('/\R/u', '[,nL]', $string); // Probleme mit Umlauten $string = preg_replace("/\r|\n/s", '[,nL]', $string);
grex
regex101 for testing
phprex for testing and visualizing
iHateRegex
Learn Regex the easy way
Last updated 2 years ago