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
1f8cee25
Kaydet (Commit)
1f8cee25
authored
Mar 14, 1997
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Hint about [\] trick to avoid quad backslashes.
üst
db5a41f1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
libregex.tex
Doc/lib/libregex.tex
+3
-2
libregex.tex
Doc/libregex.tex
+3
-2
No files found.
Doc/lib/libregex.tex
Dosyayı görüntüle @
1f8cee25
...
...
@@ -22,9 +22,10 @@ is because Python doesn't remove backslashes from string literals if
they are followed by an unrecognized escape character.
\emph
{
However
}
, if you want to include a literal
\dfn
{
backslash
}
in a
regular expression represented as a string literal, you have to
\emph
{
quadruple
}
it. E.g.
\
to extract
\LaTeX\ \samp
{
\e
section
\{
{
\rm
\emph
{
quadruple
}
it or enclose it in a singleton character class.
E.g.
\
to extract
\LaTeX\ \samp
{
\e
section
\{
{
\rm
\ldots
}
\}
}
headers from a document, you can use this pattern:
\code
{
'
\e
\e
\e
\e
section
\{\e
(.*
\e
)
\}
'
}
.
\emph
{
Another exception:
}
\code
{
'
[
\e
]
section
\{\e
(.*
\e
)
\}
'
}
.
\emph
{
Another exception:
}
the escape sequece
\samp
{
\e
b
}
is significant in string literals
(where it means the ASCII bell character) as well as in Emacs regular
expressions (where it stands for a word boundary), so in order to
...
...
Doc/libregex.tex
Dosyayı görüntüle @
1f8cee25
...
...
@@ -22,9 +22,10 @@ is because Python doesn't remove backslashes from string literals if
they are followed by an unrecognized escape character.
\emph
{
However
}
, if you want to include a literal
\dfn
{
backslash
}
in a
regular expression represented as a string literal, you have to
\emph
{
quadruple
}
it. E.g.
\
to extract
\LaTeX\ \samp
{
\e
section
\{
{
\rm
\emph
{
quadruple
}
it or enclose it in a singleton character class.
E.g.
\
to extract
\LaTeX\ \samp
{
\e
section
\{
{
\rm
\ldots
}
\}
}
headers from a document, you can use this pattern:
\code
{
'
\e
\e
\e
\e
section
\{\e
(.*
\e
)
\}
'
}
.
\emph
{
Another exception:
}
\code
{
'
[
\e
]
section
\{\e
(.*
\e
)
\}
'
}
.
\emph
{
Another exception:
}
the escape sequece
\samp
{
\e
b
}
is significant in string literals
(where it means the ASCII bell character) as well as in Emacs regular
expressions (where it stands for a word boundary), so in order to
...
...
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