\L lowercase all characters till \E or end of string
\U uppercase all characters till \E or end of string
\F foldcase all characters till \E or end of string
- \Q quote non-word characters till \E or end of string
+ \Q quote (disable) pattern metacharacters till \E or
+ end of string
\E end either case modification or quoted section
(whichever was last seen)
+See L<perlfunc/quotemeta> for the exact definition of characters that
+are quoted by C<\Q>.
+
C<\L>, C<\U>, C<\F>, and C<\Q> can stack, in which case you need one
C<\E> for each. For example:
I<need> to use literal backslashes within C<\Q...\E>,
consult L<perlop/"Gory details of parsing quoted constructs">.
+C<quotemeta()> and C<\Q> are fully described in L<perlfunc/quotemeta>.
+
=head2 Extended Patterns
Perl also defines a consistent extension syntax for features not
\o{} Octal escape sequence.
\p{}, \pP Character with the given Unicode property.
\P{}, \PP Character without the given Unicode property.
- \Q Quotemeta till \E. Not in [].
+ \Q Quote (disable) pattern metacharacters till \E. Not
+ in [].
\r Return character.
\R Generic new line. Not in [].
\s Character class for whitespace.
C<\E>, whichever comes first. They provide functionality similar to what
the functions C<lc> and C<uc> provide.
-C<\Q> is used to escape all characters following, up to the next C<\E>
-or the end of the pattern. C<\Q> adds a backslash to any character that
-isn't a letter, digit, or underscore. This ensures that any character
-between C<\Q> and C<\E> shall be matched literally, not interpreted
-as a metacharacter by the regex engine.
+C<\Q> is used to quote (disable) pattern metacharacters, up to the next
+C<\E> or the end of the pattern. C<\Q> adds a backslash to any character
+that could have special meaning to Perl. In the ASCII range, it quotes
+every character that isn't a letter, digit, or underscore. See
+L<perlfunc/quotemeta> for details on what gets quoted for non-ASCII
+code points. Using this ensures that any character between C<\Q> and
+C<\E> will be matched literally, not interpreted as a metacharacter by
+the regex engine.
C<\F> can be used to casefold all characters following, up to the next C<\E>
or the end of the pattern. It provides the functionality similar to