As I said, the ?: makes it so the group within the () is not captured. Observe...
Without ?::
perl -E '"123" =~ /(2|3)/; say $1' 2
With ?::
perl -E '"123" =~ /(?:2|3)/; say $1'
Note how using the ?: doesn't put anything into the special numbered $1 variable. See perlretut's Non-Capturing Groupings
In reply to Re^3: Regular expressions
by stevieb
in thread Regular expressions
by lairel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |