From ae3bb8eaaa75dd43e8b8c8e32e106da36f49dee7 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 19 Feb 2015 15:19:08 -0700 Subject: Add qr/\b{wb}/ --- pod/perlretut.pod | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'pod/perlretut.pod') 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, -- cgit v1.2.1