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
e53793bf
Kaydet (Commit)
e53793bf
authored
Eyl 25, 2000
tarafından
Fred Drake
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Updates from Fredrik Lundh <effbot@telia.com> about Unicode-related
behavior.
üst
af574317
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
31 deletions
+43
-31
libre.tex
Doc/lib/libre.tex
+43
-31
No files found.
Doc/lib/libre.tex
Dosyayı görüntüle @
e53793bf
...
...
@@ -175,13 +175,14 @@ Extensions usually do not create a new group;
\regexp
{
(?P<
\var
{
name
}
>...)
}
is the only exception to this rule.
Following are the currently supported extensions.
\item
[\code{(?iLmsx)}]
(One or more letters from the set
\character
{
i
}
,
\character
{
L
}
,
\character
{
m
}
,
\character
{
s
}
,
\character
{
x
}
.) The group matches
the empty string; the letters set the corresponding flags
(
\constant
{
re.I
}
,
\constant
{
re.L
}
,
\constant
{
re.M
}
,
\constant
{
re.S
}
,
\constant
{
re.X
}
) for the entire regular expression. This is useful if
you wish to include the flags as part of the regular expression, instead
of passing a
\var
{
flag
}
argument to the
\function
{
compile()
}
function.
\item
[\code{(?iLmsux)}]
(One or more letters from the set
\character
{
i
}
,
\character
{
L
}
,
\character
{
m
}
,
\character
{
s
}
,
\character
{
u
}
,
\character
{
x
}
.) The group matches the empty string; the letters set
the corresponding flags (
\constant
{
re.I
}
,
\constant
{
re.L
}
,
\constant
{
re.M
}
,
\constant
{
re.S
}
,
\constant
{
re.U
}
,
\constant
{
re.X
}
)
for the entire regular expression. This is useful if you wish to
include the flags as part of the regular expression, instead of
passing a
\var
{
flag
}
argument to the
\function
{
compile()
}
function.
\item
[\code{(?:...)}]
A non-grouping version of regular parentheses.
Matches whatever regular expression is inside the parentheses, but the
...
...
@@ -227,7 +228,6 @@ resulting RE will match the second character. For example,
\begin{list}
{}{
\leftmargin
0.7in
\labelwidth
0.65in
}
%
\item
[\code{\e \var{number}}]
Matches the contents of the group of the
same number. Groups are numbered starting from 1. For example,
\regexp
{
(.+)
\e
1
}
matches
\code
{
'the the'
}
or
\code
{
'55 55'
}
, but not
...
...
@@ -238,45 +238,50 @@ is 0, or \var{number} is 3 octal digits long, it will not be interpreted
as a group match, but as the character with octal value
\var
{
number
}
.
Inside the
\character
{
[
}
and
\character
{
]
}
of a character class, all numeric
escapes are treated as characters.
%
\item
[\code{\e A}]
Matches only at the start of the string.
%
\item
[\code{\e b}]
Matches the empty string, but only at the
beginning or end of a word. A word is defined as a sequence of
alphanumeric characters, so the end of a word is indicated by
whitespace or a non-alphanumeric character. Inside a character range,
\regexp
{
\e
b
}
represents the backspace character, for compatibility with
Python's string literals.
%
\item
[\code{\e B}]
Matches the empty string, but only when it is
\emph
{
not
}
at the beginning or end of a word.
%
\item
[\code{\e d}]
Matches any decimal digit; this is
equivalent to the set
\regexp
{
[0-9]
}
.
%
\item
[\code{\e D}]
Matches any non-digit character; this is
equivalent to the set
\regexp
{
[
{
\^
}
0-9]
}
.
%
\item
[\code{\e s}]
Matches any whitespace character; this is
equivalent to the set
\regexp
{
[
\e
t
\e
n
\e
r
\e
f
\e
v]
}
.
%
\item
[\code{\e S}]
Matches any non-whitespace character; this is
equivalent to the set
\regexp
{
[
\^\ \e
t
\e
n
\e
r
\e
f
\e
v]
}
.
%
\item
[\code{\e w}]
When the
\constant
{
LOCALE
}
flag is not specified,
\item
[\code{\e w}]
When the
\constant
{
LOCALE
}
and
\constant
{
UNICODE
}
flags are not specified,
matches any alphanumeric character; this is equivalent to the set
\regexp
{
[a-zA-Z0-9
_
]
}
. With
\constant
{
LOCALE
}
, it will match the set
\regexp
{
[0-9
_
]
}
plus whatever characters are defined as letters for the
current locale.
%
\item
[\code{\e W}]
When the
\constant
{
LOCALE
}
flag is not specified,
matches any non-alphanumeric character; this is equivalent to the set
\regexp
{
[
{
\^
}
a-zA-Z0-9
_
]
}
. With
\constant
{
LOCALE
}
, it will match any
character not in the set
\regexp
{
[0-9
_
]
}
, and not defined as a letter
for the current locale.
\regexp
{
[0-9
_
]
}
plus whatever characters are defined as letters for
the current locale. If
\constant
{
UNICODE
}
is set, this will match the
characters
\regexp
{
[0-9
_
]
}
plus whatever is classified as alphanumeric
in the Unicode character properties database.
\item
[\code{\e W}]
When the
\constant
{
LOCALE
}
and
\constant
{
UNICODE
}
flags are not specified, matches any non-alphanumeric character; this
is equivalent to the set
\regexp
{
[
{
\^
}
a-zA-Z0-9
_
]
}
. With
\constant
{
LOCALE
}
, it will match any character not in the set
\regexp
{
[0-9
_
]
}
, and not defined as a letter for the current locale.
If
\constant
{
UNICODE
}
is set, this will match anything other than
\regexp
{
[0-9
_
]
}
and characters marked at alphanumeric in the Unicode
character properties database.
\item
[\code{\e Z}]
Matches only at the end of the string.
%
\item
[\code{\e \e}]
Matches a literal backslash.
...
...
@@ -354,8 +359,8 @@ lowercase letters, too. This is not affected by the current locale.
\begin{datadesc}
{
L
}
\dataline
{
LOCALE
}
Make
\regexp
{
\e
w
}
,
\regexp
{
\e
W
}
,
\regexp
{
\e
b
}
,
\regexp
{
\e
B
}
,
dependent on the current locale.
Make
\regexp
{
\e
w
}
,
\regexp
{
\e
W
}
,
\regexp
{
\e
b
}
,
and
\regexp
{
\e
B
}
dependent on the current locale.
\end{datadesc}
\begin{datadesc}
{
M
}
...
...
@@ -372,9 +377,16 @@ newline (if any) at the end of the string.
\begin{datadesc}
{
S
}
\dataline
{
DOTALL
}
Make the
\character
{
.
}
special character match any character at all, including a
newline; without this flag,
\character
{
.
}
will match anything
\emph
{
except
}
a newline.
Make the
\character
{
.
}
special character match any character at all,
including a newline; without this flag,
\character
{
.
}
will match
anything
\emph
{
except
}
a newline.
\end{datadesc}
\begin{datadesc}
{
U
}
\dataline
{
UNICODE
}
Make
\regexp
{
\e
w
}
,
\regexp
{
\e
W
}
,
\regexp
{
\e
b
}
, and
\regexp
{
\e
B
}
dependent on the Unicode character properties database.
\versionadded
{
2.0
}
\end{datadesc}
\begin{datadesc}
{
X
}
...
...
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