plc has asked for the wisdom of the Perl Monks concerning the following question:
Used to match blank or comment lines, I think.if ( $data =~ m/^\s*(?:#|$)/ ) {
I don't understand the usage of ?: in the grouping. Does not seem to make a difference in my testing.
So, what is the ?: for and why did they use it?Also where is the construct "?:" documented? I have searched around but it is a hard term to search for.
Thanks in advance
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Explain regex ?: usage in grouping
by kennethk (Abbot) on Oct 17, 2010 at 14:31 UTC | |
|
Re: Explain regex ?: usage in grouping
by moritz (Cardinal) on Oct 17, 2010 at 14:32 UTC | |
|
Re: Explain regex ?: usage in grouping
by Anonymous Monk on Oct 17, 2010 at 13:51 UTC | |
|
Re: Explain regex ?: usage in grouping
by aquarium (Curate) on Oct 18, 2010 at 00:43 UTC | |
|
Re: Explain regex ?: usage in grouping
by ikegami (Patriarch) on Oct 18, 2010 at 05:09 UTC |