S
Sandman
Textblock (indented for clarity):
Hello, my nickname is Sandman, here is
a list of things I like:
<ol>
<li> Perl
<li> PHP
<li> MySQL
</ol>
I want to replace newlines with "<br />\n" in this textblock, for displaying it
to a browser - but I don't want to replace it inside some specified html-tags -
in this case "ol", but also "ul", "pre" and "xmp".
So, the resulting text block should be:
Hello, my nickname is Sandman, here is<br />
a list of things I like:<br />
<br />
<ol>
<li> Perl
<li> PHP
<li> MySQL
</ol>
Is there a fancy regexp for this? I know how to exclude certain characters with
the [^...] 'switch', but what about whole blocks of text? In pseudo-code:
[^<(ol|ul|pre|xmp)>].
Hello, my nickname is Sandman, here is
a list of things I like:
<ol>
<li> Perl
<li> PHP
<li> MySQL
</ol>
I want to replace newlines with "<br />\n" in this textblock, for displaying it
to a browser - but I don't want to replace it inside some specified html-tags -
in this case "ol", but also "ul", "pre" and "xmp".
So, the resulting text block should be:
Hello, my nickname is Sandman, here is<br />
a list of things I like:<br />
<br />
<ol>
<li> Perl
<li> PHP
<li> MySQL
</ol>
Is there a fancy regexp for this? I know how to exclude certain characters with
the [^...] 'switch', but what about whole blocks of text? In pseudo-code:
[^<(ol|ul|pre|xmp)>].