Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
f93395bc
Commit
f93395bc
authored
Sep 11, 2016
by
Ethan Furman
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
issue28082: use IntFlag for re constants
parent
06339e74
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
Lib/re.py
Lib/re.py
+21
-12
No files found.
Lib/re.py
View file @
f93395bc
...
...
@@ -119,6 +119,7 @@ This module also defines an exception 'error'.
"""
import
enum
import
sre_compile
import
sre_parse
try
:
...
...
@@ -137,18 +138,26 @@ __all__ = [
__version__
=
"2.2.1"
# flags
A
=
ASCII
=
sre_compile
.
SRE_FLAG_ASCII
# assume ascii "locale"
I
=
IGNORECASE
=
sre_compile
.
SRE_FLAG_IGNORECASE
# ignore case
L
=
LOCALE
=
sre_compile
.
SRE_FLAG_LOCALE
# assume current 8-bit locale
U
=
UNICODE
=
sre_compile
.
SRE_FLAG_UNICODE
# assume unicode "locale"
M
=
MULTILINE
=
sre_compile
.
SRE_FLAG_MULTILINE
# make anchors look for newline
S
=
DOTALL
=
sre_compile
.
SRE_FLAG_DOTALL
# make dot match newline
X
=
VERBOSE
=
sre_compile
.
SRE_FLAG_VERBOSE
# ignore whitespace and comments
# sre extensions (experimental, don't rely on these)
T
=
TEMPLATE
=
sre_compile
.
SRE_FLAG_TEMPLATE
# disable backtracking
DEBUG
=
sre_compile
.
SRE_FLAG_DEBUG
# dump pattern after compilation
class
Flag
(
enum
.
IntFlag
):
ASCII
=
sre_compile
.
SRE_FLAG_ASCII
# assume ascii "locale"
IGNORECASE
=
sre_compile
.
SRE_FLAG_IGNORECASE
# ignore case
LOCALE
=
sre_compile
.
SRE_FLAG_LOCALE
# assume current 8-bit locale
UNICODE
=
sre_compile
.
SRE_FLAG_UNICODE
# assume unicode "locale"
MULTILINE
=
sre_compile
.
SRE_FLAG_MULTILINE
# make anchors look for newline
DOTALL
=
sre_compile
.
SRE_FLAG_DOTALL
# make dot match newline
VERBOSE
=
sre_compile
.
SRE_FLAG_VERBOSE
# ignore whitespace and comments
A
=
ASCII
I
=
IGNORECASE
L
=
LOCALE
U
=
UNICODE
M
=
MULTILINE
S
=
DOTALL
X
=
VERBOSE
# sre extensions (experimental, don't rely on these)
TEMPLATE
=
sre_compile
.
SRE_FLAG_TEMPLATE
# disable backtracking
T
=
TEMPLATE
DEBUG
=
sre_compile
.
SRE_FLAG_DEBUG
# dump pattern after compilation
globals
().
update
(
Flag
.
__members__
)
# sre exception
error
=
sre_compile
.
error
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment