Go4Expert (http://www.go4expert.com/)
-   Perl (http://www.go4expert.com/forums/perl/)
-   -   compatible attributes (http://www.go4expert.com/forums/compatible-attributes-t11266/)

abhisheksainiabhishe 11Jun2008 13:27

compatible attributes
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 12Jun2008 03:34

Re: compatible attributes
i got it working.
will post the part of code some time.
this thread can be closed now.

All times are GMT +5.5. The time now is 00:39.