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
3a8d1f5a
Kaydet (Commit)
3a8d1f5a
authored
Tem 20, 1998
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Modest speed improvement to escape() by Piet van Oostrum.
üst
7333c4ca
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
5 deletions
+5
-5
re.py
Lib/re.py
+5
-5
No files found.
Lib/re.py
Dosyayı görüntüle @
3a8d1f5a
...
@@ -64,13 +64,13 @@ def findall(pattern, string):
...
@@ -64,13 +64,13 @@ def findall(pattern, string):
def
escape
(
pattern
):
def
escape
(
pattern
):
"Escape all non-alphanumeric characters in pattern."
"Escape all non-alphanumeric characters in pattern."
result
=
[]
result
=
list
(
pattern
)
alphanum
=
string
.
letters
+
'_'
+
string
.
digits
alphanum
=
string
.
letters
+
'_'
+
string
.
digits
for
char
in
pattern
:
for
i
in
range
(
len
(
pattern
)):
char
=
pattern
[
i
]
if
char
not
in
alphanum
:
if
char
not
in
alphanum
:
if
char
==
'
\000
'
:
result
.
append
(
'
\\
000'
)
if
char
==
'
\000
'
:
result
[
i
]
=
'
\\
000'
else
:
result
.
append
(
'
\\
'
+
char
)
else
:
result
[
i
]
=
'
\\
'
+
char
else
:
result
.
append
(
char
)
return
string
.
join
(
result
,
''
)
return
string
.
join
(
result
,
''
)
def
compile
(
pattern
,
flags
=
0
):
def
compile
(
pattern
,
flags
=
0
):
...
...
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