Help for this page

Select Code to Download


  1. or download this
    $string =~ s/[^<B>]($swapString)[^<\/B>]/<B>$1<\/B>/gi;
    
  2. or download this
    $string =~ s/[^>]($swapString)[^<]/<B>$1<\/B>/gi;
    
  3. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    
    s/(?!<b>)(foo|bar)(?!<\/b>)/XXX/gi;
    print;