in reply to Re^7: how to remove a string from end of a line
in thread how to remove a string from end of a line
I started reading "perlretut". But I struck "?:" here. I cant understand that explanation. In the document I see this example.
$x = '12aba34ba5'; @num = split /(a|b)+/, $x; # @num = ('12','a','34','a','5') print @num,$/; @num = split /(?:a|b)+/, $x; # @num = ('12','34','5') print @num,$/;
Based on the regex explained earlier in the document I can write that code like this.
@num = split /[ab]+/, $x; # @num = ('12','34','5') print @num,$/;
But I want to know how that "?:" working in the regex. Thanks for reply
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^9: how to remove a string from end of a line
by choroba (Cardinal) on Oct 12, 2015 at 12:23 UTC | |
|
Re^9: how to remove a string from end of a line
by AnomalousMonk (Archbishop) on Oct 12, 2015 at 19:37 UTC | |
by ravi45722 (Pilgrim) on Oct 13, 2015 at 05:15 UTC |