I need to parse this string:
$str = "\n\n\nABC\n\nDEF\nGHI\n\n\nJKL" ;
into this array:
$arr = [
"\n\n\n",
"ABC\n",
"\n",
"DEF\n",
"GHI\n",
"\n\n",
"JKL"
] ;
I tried many combinations, but no luck:
$arr = preg_match_all("/[^\n]+[\n]+/",$str,$out) ;
What Regex can handle that?