[EMAIL PROTECTED] (David Gray) wrote in 003401c1d41a$595140e0$[EMAIL PROTECTED]:">news:003401c1d41a$595140e0$[EMAIL PROTECTED]:
>> I have strings like the following one: >> my $s="The <b>L</b>ibrary<b> of <font color..."; >> >> I want to truncate the string, to become >> "The <b>L</b>ibrary<b> of ..." >> (that is remove 'unterminated' html tags - tags that open but >> there is no >> '>' at the end, and add "..." if necessary) >> ... > > In an 'unterminated' tag, you would find either the end of the string or > a '<', right? How about: > > $s =~ s/<[^>]*(?:<|$)//; > > > Hope that helps, > > -dave > Thank you for your reply, what about: $s=~s/<[^>]*(?!.*?>)//; After what you've sent me, I' ve thought the above and it works. Do you think it is wrong regarding what I want to achieve? Can you think of any important difference to the one you sent me? Thanks in Advance... -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]