Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
98985a19
Kaydet (Commit)
98985a19
authored
Agu 19, 2013
tarafından
Serhiy Storchaka
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #2537: Remove breaked check which prevented valid regular expressions.
Patch by Meador Inge. See also issue #18647.
üst
1ca66edb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
2 deletions
+10
-2
sre_compile.py
Lib/sre_compile.py
+0
-2
test_re.py
Lib/test/test_re.py
+10
-0
No files found.
Lib/sre_compile.py
Dosyayı görüntüle @
98985a19
...
...
@@ -358,8 +358,6 @@ def _optimize_unicode(charset, fixup):
def
_simple
(
av
):
# check if av is a "simple" operator
lo
,
hi
=
av
[
2
]
.
getwidth
()
#if lo == 0 and hi == MAXREPEAT:
# raise error("nothing to repeat")
return
lo
==
hi
==
1
and
av
[
2
][
0
][
0
]
!=
SUBPATTERN
def
_compile_info
(
code
,
pattern
,
flags
):
...
...
Lib/test/test_re.py
Dosyayı görüntüle @
98985a19
...
...
@@ -1051,6 +1051,16 @@ class ReTests(unittest.TestCase):
[
b
'xyz'
],
msg
=
pattern
)
def
test_bug_2537
(
self
):
# issue 2537: empty submatches
for
outer_op
in
(
'{0,}'
,
'*'
,
'+'
,
'{1,187}'
):
for
inner_op
in
(
'{0,}'
,
'*'
,
'?'
):
r
=
re
.
compile
(
"^((x|y)
%
s)
%
s"
%
(
inner_op
,
outer_op
))
m
=
r
.
match
(
"xyyzy"
)
self
.
assertEqual
(
m
.
group
(
0
),
"xyy"
)
self
.
assertEqual
(
m
.
group
(
1
),
""
)
self
.
assertEqual
(
m
.
group
(
2
),
"y"
)
def
run_re_tests
():
from
test.re_tests
import
tests
,
SUCCEED
,
FAIL
,
SYNTAX_ERROR
if
verbose
:
...
...
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