Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
7bc6f7ac
Commit
7bc6f7ac
authored
Feb 14, 2002
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Consistently use \textasciicircum to produce a ^ character.
LaTeX really falls flat on this one!
parent
2eeec9bd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
18 deletions
+25
-18
Doc/lib/libre.tex
Doc/lib/libre.tex
+25
-18
No files found.
Doc/lib/libre.tex
View file @
7bc6f7ac
...
@@ -93,8 +93,9 @@ The special characters are:
...
@@ -93,8 +93,9 @@ The special characters are:
character except a newline. If the
\constant
{
DOTALL
}
flag has been
character except a newline. If the
\constant
{
DOTALL
}
flag has been
specified, this matches any character including a newline.
specified, this matches any character including a newline.
\item
[\character{\^}]
(Caret.) Matches the start of the string, and in
\item
[\character{\textasciicircum}]
(Caret.) Matches the start of the
\constant
{
MULTILINE
}
mode also matches immediately after each newline.
string, and in
\constant
{
MULTILINE
}
mode also matches immediately
after each newline.
\item
[\character{\$}]
Matches the end of the string or just before the
\item
[\character{\$}]
Matches the end of the string or just before the
newline at the end of the string, and in
\constant
{
MULTILINE
}
mode
newline at the end of the string, and in
\constant
{
MULTILINE
}
mode
...
@@ -181,10 +182,14 @@ backslash, or place it as the first character. The
...
@@ -181,10 +182,14 @@ backslash, or place it as the first character. The
pattern
\regexp
{
[]]
}
will match
\code
{
']'
}
, for example.
pattern
\regexp
{
[]]
}
will match
\code
{
']'
}
, for example.
You can match the characters not within a range by
\dfn
{
complementing
}
You can match the characters not within a range by
\dfn
{
complementing
}
the set. This is indicated by including a
\character
{
\^
}
as the first
the set. This is indicated by including a
character of the set;
\character
{
\^
}
elsewhere will simply match the
\character
{
\textasciicircum
}
as the first character of the set;
\character
{
\^
}
character. For example,
\regexp
{
[
{
\^
}
5]
}
will match
\character
{
\textasciicircum
}
elsewhere will simply match the
any character except
\character
{
5
}
.
\character
{
\textasciicircum
}
character. For example,
\regexp
{
[
{
\textasciicircum
}
5]
}
will match
any character except
\character
{
5
}
, and
\regexp
{
[
\textasciicircum\code
{
\textasciicircum
}
]
}
will match any character
except
\character
{
\textasciicircum
}
.
\item
[\character{|}]
\code
{
A|B
}
, where A and B can be arbitrary REs,
\item
[\character{|}]
\code
{
A|B
}
, where A and B can be arbitrary REs,
creates a regular expression that will match either A or B. An
creates a regular expression that will match either A or B. An
...
@@ -318,13 +323,13 @@ Python's string literals.
...
@@ -318,13 +323,13 @@ Python's string literals.
equivalent to the set
\regexp
{
[0-9]
}
.
equivalent to the set
\regexp
{
[0-9]
}
.
\item
[\code{\e D}]
Matches any non-digit character; this is
\item
[\code{\e D}]
Matches any non-digit character; this is
equivalent to the set
\regexp
{
[
{
\
^
}
0-9]
}
.
equivalent to the set
\regexp
{
[
{
\
textasciicircum
}
0-9]
}
.
\item
[\code{\e s}]
Matches any whitespace character; this is
\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]
}
.
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
\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]
}
.
equivalent to the set
\regexp
{
[
\
textasciicircum
\ \e
t
\e
n
\e
r
\e
f
\e
v]
}
.
\item
[\code{\e w}]
When the
\constant
{
LOCALE
}
and
\constant
{
UNICODE
}
\item
[\code{\e w}]
When the
\constant
{
LOCALE
}
and
\constant
{
UNICODE
}
flags are not specified,
flags are not specified,
...
@@ -337,7 +342,7 @@ in the Unicode character properties database.
...
@@ -337,7 +342,7 @@ in the Unicode character properties database.
\item
[\code{\e W}]
When the
\constant
{
LOCALE
}
and
\constant
{
UNICODE
}
\item
[\code{\e W}]
When the
\constant
{
LOCALE
}
and
\constant
{
UNICODE
}
flags are not specified, matches any non-alphanumeric character; this
flags are not specified, matches any non-alphanumeric character; this
is equivalent to the set
\regexp
{
[
{
\
^
}
a-zA-Z0-9
_
]
}
. With
is equivalent to the set
\regexp
{
[
{
\
textasciicircum
}
a-zA-Z0-9
_
]
}
. With
\constant
{
LOCALE
}
, it will match any character not in the set
\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
_
]
}
, and not defined as a letter for the current locale.
If
\constant
{
UNICODE
}
is set, this will match anything other than
If
\constant
{
UNICODE
}
is set, this will match anything other than
...
@@ -361,7 +366,8 @@ semantics, the search operation is what you're looking for. See the
...
@@ -361,7 +366,8 @@ semantics, the search operation is what you're looking for. See the
regular expression objects.
regular expression objects.
Note that match may differ from search using a regular expression
Note that match may differ from search using a regular expression
beginning with
\character
{
\^
}
:
\character
{
\^
}
matches only at the
beginning with
\character
{
\textasciicircum
}
:
\character
{
\textasciicircum
}
matches only at the
start of the string, or in
\constant
{
MULTILINE
}
mode also immediately
start of the string, or in
\constant
{
MULTILINE
}
mode also immediately
following a newline. The ``match'' operation succeeds only if the
following a newline. The ``match'' operation succeeds only if the
pattern matches at the start of the string regardless of mode, or at
pattern matches at the start of the string regardless of mode, or at
...
@@ -429,14 +435,14 @@ Make \regexp{\e w}, \regexp{\e W}, \regexp{\e b}, and
...
@@ -429,14 +435,14 @@ Make \regexp{\e w}, \regexp{\e W}, \regexp{\e b}, and
\begin{datadesc}
{
M
}
\begin{datadesc}
{
M
}
\dataline
{
MULTILINE
}
\dataline
{
MULTILINE
}
When specified, the pattern character
\character
{
\
^
}
matches at the
When specified, the pattern character
\character
{
\
textasciicircum
}
beginning of the string and at the beginning of each line
matches at the beginning of the string and at the beginning of each
(immediately following each newline); and the pattern character
line
(immediately following each newline); and the pattern character
\character
{
\$
}
matches at the end of the string and at the end of each
\character
{
\$
}
matches at the end of the string and at the end of each
line (immediately preceding each newline). By default,
\character
{
\^
}
line (immediately preceding each newline). By default,
matches only at the beginning of the string, and
\character
{
\$
}
only
\character
{
\textasciicircum
}
matches only at the beginning of the
at the end of the string and immediately before the newline (if any)
string, and
\character
{
\$
}
only at the end of the string and
at the end of the string.
immediately before the newline (if any)
at the end of the string.
\end{datadesc}
\end{datadesc}
\begin{datadesc}
{
S
}
\begin{datadesc}
{
S
}
...
@@ -623,7 +629,8 @@ attributes:
...
@@ -623,7 +629,8 @@ attributes:
The optional second parameter
\var
{
pos
}
gives an index in the string
The optional second parameter
\var
{
pos
}
gives an index in the string
where the search is to start; it defaults to
\code
{
0
}
. This is not
where the search is to start; it defaults to
\code
{
0
}
. This is not
completely equivalent to slicing the string; the
\code
{
'
\^
'
}
pattern
completely equivalent to slicing the string; the
\code
{
'
\textasciicircum
'
}
pattern
character matches at the real beginning of the string and at positions
character matches at the real beginning of the string and at positions
just after a newline, but not necessarily at the index where the search
just after a newline, but not necessarily at the index where the search
is to start.
is to start.
...
...
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