hello i have to get any lines without html tags into this format
<p>lorem ipsum</p>
e.g.
hello world
<h2>lol</h2>
lorem ipsum
dolor sit
amet
consetetur
should parsed to
<p>hello world</p>
<h2>lol</h2>
<p>lorem ipsum
dolor sit
amet</p>
<p>consetetur</p>
i tried this with the php function preg_replace();
does someone can help?
P.S. I'll trie to get this syntax into html
# header 1 // <h1>header 1</h1>
## header 2 // <h2>header 2</h2>
and all lines without header should parse into
... my headers will be parsed but the paragraphs not
\1
this is the regex i tried in different variants – craver Jun 07 '11 at 12:09