in reply to Re: Strange regex needed
in thread Strange regex needed

Thank you. I just now realized that it's not just the class= but all elements (border, width, colspan) have the possibility of not having quotes around them. Guess I will go back to the drawing board. Thanks again.

Replies are listed 'Best First'.
Re^3: Strange regex needed
by GrandFather (Saint) on Nov 20, 2014 at 00:16 UTC
    $string =~ s/\b(class|border|width|colspan)=([^" &]+)/$1="$2"/g;
    Perl is the programming world's equivalent of English