Forum Moderators: coopster
Also, is there any way to do this in a single preg_replace() instead of using two as i have below?
$text = "normal text blah blah blah
==list item.
==another item.
==test. test.
==something else.";
$text = nl2br($text);
$text = preg_replace('/(<br \/\>([\n\r]\s))((==[-a-zA-Z0-9( )_\.,\"\'?!\/&()+:;]+(<br \/\>([\n\r]\s)))+)/', "<ul>$3</ul>", $text);
$text = preg_replace('/(==)(.*)(<br \/>)/',"<li>$2</li>",$text);
$text = preg_replace('/((==.+(\n)?)+)/', "<ul>$1</ul>", $text);
$text = preg_replace('/(==)([^<]*)/',"<li>$2</li>",$text);
I would still like to know if it is possible to do something like this using only 1 preg_replace() instead of doing it in 2 steps.