Apply PHP regex replace on a multi-line repeted pattern
- by Hussain
Let's say I have this input:
I can haz a listz0rs!
# 42
# 126
I can haz another list plox?
# Hello, world!
# Welcome!
I want to split it so that each set of hash-started lines becomes a list:
I can haz a listz0rs!
<ul>
<li>42</li>
<li>126</li>
</ul>
I can haz another list plox?
<ul>
…