Hi guys,

I have a problem with a Regular expression.
I have to delete from a text all HTML tags but not the DIV one (keeping all the 
parameters in the
tag).

I've done this:

^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
#!/usr/bin/perl
use strict;
my $test=<<EOS;
<html><head><meta content="MSHTML 6.00.2800.1400" name="GENERATOR">
</head><body><font face="Courier New" size=2>
=========SUPER SAVING========= <br>
-product one <br>
-product two <br><D>
-product three <br><dIV section=true>
============================== <Br></DIV>
<br><br></font></body> </html> 
EOS
$test=~s/<br>/\n/ig;
$test=~s/<^[DIV](.*?)>//ig;
print $test;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
with this I can hav ALMOST what I want. 
I delete all HTML tags but <DIV> one but I also keep a <D> tag and I delete the </DIV> 
tag that I
would like to keep

The problem is in the ^[DIV] part of my regex....the "DIV" string is used as list of 
chars and not
as whole world. Is there a way to archieve my goal?

tnx in advance
Francesco


                
__________________________________
Do you Yahoo!?
Yahoo! Mail - 50x more storage than other providers!
http://promotions.yahoo.com/new_mail

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to