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
46ccd1da
Commit
46ccd1da
authored
Aug 28, 2001
by
Eric S. Raymond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Plant a mention in the description of backreferences of the fact that
while \0 doesn't do what one might expect, \g<0> does.
parent
8c64a54f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
Doc/lib/libre.tex
Doc/lib/libre.tex
+5
-1
No files found.
Doc/lib/libre.tex
View file @
46ccd1da
...
...
@@ -297,6 +297,8 @@ the space after the group). This special sequence can only be used to
match one of the first 99 groups. If the first digit of
\var
{
number
}
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
}
.
(There is a group 0, which is the entire matched pattern, but it can't
be referenced with
\regexp
{
\e
0
}
; instead, use
\regexp
{
\e
g<0>
}
.)
Inside the
\character
{
[
}
and
\character
{
]
}
of a character class, all numeric
escapes are treated as characters.
...
...
@@ -566,7 +568,9 @@ ignored.
\samp
{
\e
g<2>
}
is therefore equivalent to
\samp
{
\e
2
}
, but isn't
ambiguous in a replacement such as
\samp
{
\e
g<2>0
}
.
\samp
{
\e
20
}
would be interpreted as a reference to group 20, not a reference to
group 2 followed by the literal character
\character
{
0
}
.
group 2 followed by the literal character
\character
{
0
}
. The
backreference
\samp
{
\e
g<0>
}
substitutes in the entire substring
matched by the RE.
\end{funcdesc}
\begin{funcdesc}
{
subn
}{
pattern, repl, string
\optional
{
, count
}}
...
...
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