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
6fa0c5a4
Commit
6fa0c5a4
authored
Sep 14, 2005
by
Gustavo Niemeyer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
considering it exactly like a '*'.
parent
0c55f294
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
0 deletions
+10
-0
Lib/sre_parse.py
Lib/sre_parse.py
+3
-0
Lib/test/test_re.py
Lib/test/test_re.py
+3
-0
Misc/NEWS
Misc/NEWS
+4
-0
No files found.
Lib/sre_parse.py
View file @
6fa0c5a4
...
...
@@ -485,6 +485,9 @@ def _parse(source, state):
elif
this
==
"+"
:
min
,
max
=
1
,
MAXREPEAT
elif
this
==
"{"
:
if
source
.
next
==
"}"
:
subpatternappend
((
LITERAL
,
ord
(
this
)))
continue
here
=
source
.
tell
()
min
,
max
=
0
,
MAXREPEAT
lo
=
hi
=
""
...
...
Lib/test/test_re.py
View file @
6fa0c5a4
...
...
@@ -297,6 +297,9 @@ class ReTests(unittest.TestCase):
self.assertNotEqual(re.match("^x{1,4}?$", "xxx"), None)
self.assertNotEqual(re.match("^x{3,4}?$", "xxx"), None)
self.assertEqual(re.match("^x{}$", "xxx"), None)
self.assertNotEqual(re.match("^x{}$", "x{}"), None)
def test_getattr(self):
self.assertEqual(re.match("(a)", "a").pos, 0)
self.assertEqual(re.match("(a)", "a").endpos, 1)
...
...
Misc/NEWS
View file @
6fa0c5a4
...
...
@@ -443,6 +443,10 @@ Library
from the input stream, so that the output is a byte string in the correct
encoding instead of a unicode string.
- Bug #1202493: Fixing SRE parser to handle '
{}
' as perl does, rather than
considering it exactly like a '
*
'.
Build
-----
...
...
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