my $junk = '<>]="\''; $text =~ s{(?!$junk)\b($urls:[$any] +?)(?=[$punc]* [^$any]|$) }{$1}migox;