compatible attributes

abhisheksainiabhishe's Avatar
Light Poster
If I have want to combine tags with compatible attributes like...

<font color="blue" font="Times"><font size="14"abcdegh</font></font>


<font color="blue" font="Times" size="14"abcdegh</font>

as I have have it all in one scalar variable

I thoughtI would have something like..

my $startFontTag="<font";
my $endFontTag="</font>";

$string =~ s/$startFontTag[\w*|\s*|\S*]$startFontTag[\w*|\s*|\S*]/$1/gi;

but I dont think the above approach is going to work.

Should I do something like first check the string to see if any occurence of
</font></font> occurse then delete one of them and move back to check staring font tasg
and to combine them.

abhisheksainiabhishe's Avatar
Light Poster
i got it working.
will post the part of code some time.
this thread can be closed now.