Match text outside of tags (PHP)

7 views
Skip to first unread message

Jon

unread,
Aug 7, 2009, 8:12:18 AM8/7/09
to Regex
I'm trying to either:

a. Match all text outside of multiple <pre> tags or
b. Match the newline character outside of multiple <pre> tags

I want to replace newlines with line breaks, but ignore text inside
<pre> tags. I've managed to match everything inside and including the
tags, but that's not exactly what I want. Any suggestions?

Jon

unread,
Aug 7, 2009, 9:27:25 AM8/7/09
to Regex
I don't know that I can edit my post...but I've changed my mind. Just
matching the text outside of <pre> tags won't do - it would end up
being just as much work as some other solutions in the end. I'm aiming
for a simple solution, so just need to match newlines outside of <pre>
tags. Thanks!
Reply all
Reply to author
Forward
0 new messages