Regex teaser

Mark Fowler mark at twoshortplanks.com
Wed Dec 4 01:03:57 GMT 2013


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.


More information about the london.pm mailing list