On Tue, Dec 3, 2013 at 6:54 PM, Paul Makepeace <paulm at paulm.com> wrote: > $ perl -le '($a = "aabbb") =~ s/b*$/c/g; print $a' This is where tools like Regexp::Debugger shine. Running perl -le 'use Regexp::Debugger; ($a = "aabbb") =~ s/b*$/c/g; print $a' Shows exactly why it gives the output it does (if you hit "n" for next a lot) Mark.