Help for this page

Select Code to Download


  1. or download this
    my $a = "xx|xx|xx|xxxx|xx|xxx|xx|xx|xx";
    $a =~ s/(?<=\|)xx(?=(\||$))/x x/g;
    print $a;
    __DATA__
    xx|x x|x x|xxxx|x x|xxx|x x|x x|x x
    
  2. or download this
    $a =~ s/(?<=\|)|^xx(?=(\||$))/x x/g;
    
    ...
    # if they exist in practice as your real data is no doubt
    # not really xx.....
    $a =~ s/\bxx\b/x x/g;