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
6076ea51
Kaydet (Commit)
6076ea51
authored
Haz 26, 1996
tarafından
Guido van Rossum
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Added thread unsafety warning. Added optional retain arg to split.
üst
7c2fdda0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
libregsub.tex
Doc/lib/libregsub.tex
+6
-1
libregsub.tex
Doc/libregsub.tex
+6
-1
No files found.
Doc/lib/libregsub.tex
Dosyayı görüntüle @
6076ea51
...
...
@@ -4,6 +4,8 @@
This module defines a number of functions useful for working with
regular expressions (see built-in module
\code
{
regex
}
).
Warning: these functions are not thread-safe.
\renewcommand
{
\indexsubitem
}{
(in module regsub)
}
\begin{funcdesc}
{
sub
}{
pat
\,
repl
\,
str
}
Replace the first occurrence of pattern
\var
{
pat
}
in string
...
...
@@ -21,10 +23,13 @@ when not adjacent to a previous match, so e.g.
\code
{
gsub('', '-', 'abc')
}
returns
\code
{
'-a-b-c-'
}
.
\end{funcdesc}
\begin{funcdesc}
{
split
}{
str
\,
pat
}
\begin{funcdesc}
{
split
}{
str
\,
pat
\optional
{
\,
retain
}
}
Split the string
\var
{
str
}
in fields separated by delimiters matching
the pattern
\var
{
pat
}
, and return a list containing the fields. Only
non-empty matches for the pattern are considered, so e.g.
\code
{
split('a:b', ':*')
}
returns
\code
{
['a', 'b']
}
and
\code
{
split('abc', '')
}
returns
\code
{
['abc']
}
.
If the optional
\var
{
retain
}
argument is true, the separators are also
inserted in the list, so e.g.
\code
{
split('a:::b', ':*', 1)
}
returns
\code
{
['a', ':::', 'b']
}
.
\end{funcdesc}
Doc/libregsub.tex
Dosyayı görüntüle @
6076ea51
...
...
@@ -4,6 +4,8 @@
This module defines a number of functions useful for working with
regular expressions (see built-in module
\code
{
regex
}
).
Warning: these functions are not thread-safe.
\renewcommand
{
\indexsubitem
}{
(in module regsub)
}
\begin{funcdesc}
{
sub
}{
pat
\,
repl
\,
str
}
Replace the first occurrence of pattern
\var
{
pat
}
in string
...
...
@@ -21,10 +23,13 @@ when not adjacent to a previous match, so e.g.
\code
{
gsub('', '-', 'abc')
}
returns
\code
{
'-a-b-c-'
}
.
\end{funcdesc}
\begin{funcdesc}
{
split
}{
str
\,
pat
}
\begin{funcdesc}
{
split
}{
str
\,
pat
\optional
{
\,
retain
}
}
Split the string
\var
{
str
}
in fields separated by delimiters matching
the pattern
\var
{
pat
}
, and return a list containing the fields. Only
non-empty matches for the pattern are considered, so e.g.
\code
{
split('a:b', ':*')
}
returns
\code
{
['a', 'b']
}
and
\code
{
split('abc', '')
}
returns
\code
{
['abc']
}
.
If the optional
\var
{
retain
}
argument is true, the separators are also
inserted in the list, so e.g.
\code
{
split('a:::b', ':*', 1)
}
returns
\code
{
['a', ':::', 'b']
}
.
\end{funcdesc}
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