L
Lex
Hi, I'm stuck with a pattern match thing.
What I actually want a script to do is the following:
look for <pre> and </pre> and erase all the <br> that you find within it, no
matter what you find. However: leave the rest! ( linebreaks etc.)
But I don't know how to do it properly.
I tried doing this:
in stead of:
----------------------------------------------------------------------------
----
Code
----------------------------------------------------------------------------
----
$rec{'Text'} =~ s%<pre>(.*?)<br>(.*?)</pre>%<pre>$1 $2</pre>%gim;
----------------------------------------------------------------------------
----
I tried:
----------------------------------------------------------------------------
----
Code
----------------------------------------------------------------------------
----
$rec{'Text'} =~ s%<pre>((.|\n)*?)<br>((.|\n)*?)</pre>%<pre>$1 $2</pre>%gim;
----------------------------------------------------------------------------
----
But that would just erase everything between <pre> and </pre> in the next
example:
----------------------------------------------------------------------------
----
Code
----------------------------------------------------------------------------
----
<br><b>Medische reden WAO-uitkering, in percentages</b>
<br><pre>
Turken Marokkanen Nederlanders
<br>Klachten aan het bewegingsapparaat 36 35 36
<br>Psychische klachten 23 26 27
<br>Overig 41 39 37
<br></pre>
----------------------------------------------------------------------------
----
(still studying 'programming perl')
If anybody has a good suggestion...
Thanks for your time reading this.
Lex
What I actually want a script to do is the following:
look for <pre> and </pre> and erase all the <br> that you find within it, no
matter what you find. However: leave the rest! ( linebreaks etc.)
But I don't know how to do it properly.
I tried doing this:
in stead of:
----------------------------------------------------------------------------
----
Code
----------------------------------------------------------------------------
----
$rec{'Text'} =~ s%<pre>(.*?)<br>(.*?)</pre>%<pre>$1 $2</pre>%gim;
----------------------------------------------------------------------------
----
I tried:
----------------------------------------------------------------------------
----
Code
----------------------------------------------------------------------------
----
$rec{'Text'} =~ s%<pre>((.|\n)*?)<br>((.|\n)*?)</pre>%<pre>$1 $2</pre>%gim;
----------------------------------------------------------------------------
----
But that would just erase everything between <pre> and </pre> in the next
example:
----------------------------------------------------------------------------
----
Code
----------------------------------------------------------------------------
----
<br><b>Medische reden WAO-uitkering, in percentages</b>
<br><pre>
Turken Marokkanen Nederlanders
<br>Klachten aan het bewegingsapparaat 36 35 36
<br>Psychische klachten 23 26 27
<br>Overig 41 39 37
<br></pre>
----------------------------------------------------------------------------
----
(still studying 'programming perl')
If anybody has a good suggestion...
Thanks for your time reading this.
Lex