Skip to content

Commit 686d508

Browse files
bpo-40016: re docstring: Clarify relationship of inline and argument flags (GH-19078)
Co-authored-by: Terry Jan Reedy <[email protected]> (cherry picked from commit 89a2209) Co-authored-by: Ram Rachum <[email protected]>
1 parent 2227c1a commit 686d508

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

Lib/re.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
"|" A|B, creates an RE that will match either A or B.
4545
(...) Matches the RE inside the parentheses.
4646
The contents can be retrieved or matched later in the string.
47-
(?aiLmsux) Set the A, I, L, M, S, U, or X flag for the RE (see below).
47+
(?aiLmsux) The letters set the corresponding flags defined below.
4848
(?:...) Non-grouping version of regular parentheses.
4949
(?P<name>...) The substring matched by the group is accessible by name.
5050
(?P=name) Matches the text matched earlier by the group named name.
@@ -97,7 +97,9 @@
9797
purge Clear the regular expression cache.
9898
escape Backslash all non-alphanumerics in a string.
9999
100-
Some of the functions in this module takes flags as optional parameters:
100+
Each function other than purge and escape can take an optional 'flags' argument
101+
consisting of one or more of the following module constants, joined by "|".
102+
A, L, and U are mutually exclusive.
101103
A ASCII For string patterns, make \w, \W, \b, \B, \d, \D
102104
match the corresponding ASCII character categories
103105
(rather than the whole Unicode categories, which is the
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
In re docstring, clarify the relationship between inline and argument compile flags.

0 commit comments

Comments
 (0)