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
19f977ba
Commit
19f977ba
authored
Sep 24, 2000
by
Fredrik Lundh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- don't hang if group id is followed by whitespace (closes bug #114660)
parent
96753b34
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
2 deletions
+4
-2
Lib/sre_parse.py
Lib/sre_parse.py
+1
-1
Lib/test/re_tests.py
Lib/test/re_tests.py
+0
-1
Lib/test/test_sre.py
Lib/test/test_sre.py
+3
-0
No files found.
Lib/sre_parse.py
View file @
19f977ba
...
...
@@ -634,7 +634,7 @@ def parse_template(source, pattern):
while
1
:
group
=
_group
(
this
,
pattern
.
groups
+
1
)
if
group
:
if
(
not
s
.
next
or
if
(
s
.
next
not
in
DIGITS
or
not
_group
(
this
+
s
.
next
,
pattern
.
groups
+
1
)):
code
=
MARK
,
int
(
group
)
break
...
...
Lib/test/re_tests.py
View file @
19f977ba
#!/usr/bin/env python
# -*- mode: python -*-
# $Id$
# Re test suite and benchmark suite v1.5
...
...
Lib/test/test_sre.py
View file @
19f977ba
...
...
@@ -114,6 +114,9 @@ test(r"""sre.sub(r'^\s*', 'X', 'test')""", 'Xtest')
test
(
r"""sre.sub(r'a', 'b', 'aaaaa')"""
,
'bbbbb'
)
test
(
r"""sre.sub(r'a', 'b', 'aaaaa', 1)"""
,
'baaaa'
)
# bug 114660
test
(
r"""sre.sub(r'(\
S)
\s+(\
S)
', r'\1 \2', 'hello there')"""
,
'hello there'
)
if
verbose
:
print
'Running tests on symbolic references'
...
...
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