summaryrefslogtreecommitdiff
path: root/pod/perlretut.pod
diff options
context:
space:
mode:
authorKarl Williamson <khw@cpan.org>2015-02-19 15:19:08 -0700
committerKarl Williamson <khw@cpan.org>2015-02-19 23:05:44 -0700
commitae3bb8eaaa75dd43e8b8c8e32e106da36f49dee7 (patch)
treed603c2149e568651c11035abc100775d6099eb68 /pod/perlretut.pod
parent53255578b3ff804b2a8449c49c2ee29cccd56fb0 (diff)
downloadperl-ae3bb8eaaa75dd43e8b8c8e32e106da36f49dee7.tar.gz
Add qr/\b{wb}/
Diffstat (limited to 'pod/perlretut.pod')
-rw-r--r--pod/perlretut.pod5
1 files changed, 5 insertions, 0 deletions
diff --git a/pod/perlretut.pod b/pod/perlretut.pod
index c5d88910a2..cb399ab631 100644
--- a/pod/perlretut.pod
+++ b/pod/perlretut.pod
@@ -459,6 +459,11 @@ character C<\w\W> or C<\W\w>:
Note in the last example, the end of the string is considered a word
boundary.
+For natural language processing (so that, for example, apostrophes are
+included in words), use instead C<\b{wb}>
+
+ "don't" =~ / .+? \b{wb} /x; # matches the whole string
+
You might wonder why C<'.'> matches everything but C<"\n"> - why not
every character? The reason is that often one is matching against
lines and would like to ignore the newline characters. For instance,