diff options
author | Matthew Horsfall <wolfsage@gmail.com> | 2014-12-29 19:21:39 -0500 |
---|---|---|
committer | Matthew Horsfall <wolfsage@gmail.com> | 2014-12-30 08:13:16 -0500 |
commit | 33be4c6111bea619c1662d201ad9e3914c2013e5 (patch) | |
tree | b8cef87673636350254c6b6d375ded971d905e0c /pod/perlretut.pod | |
parent | 207807e13c0ffe818692b731054954db1a168e25 (diff) | |
download | perl-33be4c6111bea619c1662d201ad9e3914c2013e5.tar.gz |
Add documentation for /n (non-capture) regexp flag.
Diffstat (limited to 'pod/perlretut.pod')
-rw-r--r-- | pod/perlretut.pod | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pod/perlretut.pod b/pod/perlretut.pod index 79400fc19d..957b29686d 100644 --- a/pod/perlretut.pod +++ b/pod/perlretut.pod @@ -958,6 +958,12 @@ required for some reason: @num = split /(a|b)+/, $x; # @num = ('12','a','34','a','5') @num = split /(?:a|b)+/, $x; # @num = ('12','34','5') +In Perl 5.22 and later, all groups within a regexp can be set to +non-capturing by using the new C</n> flag: + + "hello" =~ /(hi|hello)/n; # $1 is not set! + +See L<perlre/"n"> for more information. =head2 Matching repetitions |