diff options
author | Ram Rachum <ram@rachum.com> | 2020-03-25 18:44:47 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-03-25 18:44:47 (GMT) |
commit | 89a2209ae6fc5f39868621799730e16f931eb497 (patch) | |
tree | de3090d82ffb4fbd716925c1c325dfe54b8e949b /Lib/re.py | |
parent | 87d3b9db4ade1aa100ee6f065082cb7e85b8992f (diff) | |
download | cpython-89a2209ae6fc5f39868621799730e16f931eb497.zip cpython-89a2209ae6fc5f39868621799730e16f931eb497.tar.gz cpython-89a2209ae6fc5f39868621799730e16f931eb497.tar.bz2 |
bpo-40016: re docstring: Clarify relationship of inline and argument flags (#19078)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Diffstat (limited to 'Lib/re.py')
-rw-r--r-- | Lib/re.py | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -44,7 +44,7 @@ The special characters are: "|" A|B, creates an RE that will match either A or B. (...) Matches the RE inside the parentheses. The contents can be retrieved or matched later in the string. - (?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below). + (?aiLmsux) The letters set the corresponding flags defined below. (?:...) Non-grouping version of regular parentheses. (?P<name>...) The substring matched by the group is accessible by name. (?P=name) Matches the text matched earlier by the group named name. @@ -97,7 +97,9 @@ This module exports the following functions: purge Clear the regular expression cache. escape Backslash all non-alphanumerics in a string. -Some of the functions in this module takes flags as optional parameters: +Each function other than purge and escape can take an optional 'flags' argument +consisting of one or more of the following module constants, joined by "|". +A, L, and U are mutually exclusive. A ASCII For string patterns, make \w, \W, \b, \B, \d, \D match the corresponding ASCII character categories (rather than the whole Unicode categories, which is the |