Help for this page

Select Code to Download


  1. or download this
    # Appends to the 3rd occurence of 'abc' from start-of-line
    ($a = $ref) =~ s/^(?:.*?abc\K){3}/___/;
    ...
    # omit ^ to append to every 1st occurence of 'abc'
    ($a = $ref) =~ s/(?:.*?abc\K){1}/___/g;
    print $a;