in reply to Re: regexp: non-capturing grouping in replacement possible?
in thread regexp: non-capturing grouping in replacement possible?

thanks but it is not about zeros but about learning. I could remove zeroes with a simple 0*.
$str =~ s/^(hello kitty )0*(\d+)(x\d+.*)$/$1$2$3/;

Replies are listed 'Best First'.
Re^3: regexp: non-capturing grouping in replacement possible?
by happy.barney (Friar) on Nov 26, 2009 at 16:14 UTC
    learning? this one also removes any leading zero of number after "hello kitty" :-)
    s/(?<=hello kitty )0*(?=\d(?!\d))//
    Update: oops, small mistake, \b replaced with (?!\d)