clarify description of ^ and $ in the manual
2008-07-10 Paolo Bonzini <bonzini@gnu.org> * doc/sed-in.texi: Make the description of ^ and $ more precise. * doc/sed.texi: Regenerate.
This commit is contained in:
1 parent
f3f4680e98
commit
23933b640d
4 files changed
+44
-26
No files matched your search
@@ -1,3 +1,8 @@
|
||||
2008-07-10 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* doc/sed-in.texi: Make the description of ^ and $ more precise.
|
||||
* doc/sed.texi: Regenerate.
|
||||
|
||||
2008-05-15 Paolo Bonzini <bonzini@gnu.org>
|
||||
|
||||
* autoboot.conf: Update for newer gnulib.
|
||||
|
||||
@@ -7,6 +7,7 @@ Bruno Haible <haible@ilog.fr>
|
||||
Chip Salzenberg <chip@fin.uucp>
|
||||
Chris Weber <weber@bucknell.edu>
|
||||
Corinna Vinschen <vinschen@redhat.com>
|
||||
Daniel R. Grayson <dan@math.uiuc.edu>
|
||||
David Eckelkamp <eckelkamp@mcc.com>
|
||||
David J. MacKenzie <djm@nutrimat>
|
||||
David Schmidt <davids@isc-br.isc-br.com>
|
||||
|
||||
+19
-13
@@ -210,7 +210,8 @@ then exit.
|
||||
@opindex --silent
|
||||
@cindex Disabling autoprint, from command line
|
||||
By default, @command{sed} prints out the pattern space
|
||||
at the end of each cycle through the script.
|
||||
at the end of each cycle through the script (@pxref{Execution Cycle, ,
|
||||
How @code{sed} works}).
|
||||
These options disable this automatic printing,
|
||||
and @command{sed} only produces output when explicitly told to
|
||||
via the @code{p} command.
|
||||
@@ -715,21 +716,26 @@ Use back references (see below).
|
||||
Matches any character, including newline.
|
||||
|
||||
@item ^
|
||||
Matches the null string at beginning of line, i.e. what
|
||||
appears after the circumflex must appear at the
|
||||
beginning of line. @code{^#include} will match only
|
||||
lines where @samp{#include} is the first thing on line---if
|
||||
there are spaces before, for example, the match fails.
|
||||
@code{^} acts as a special character only at the beginning
|
||||
of the regular expression or subexpression (that is,
|
||||
after @code{\(} or @code{\|}). Portable scripts should avoid
|
||||
@code{^} at the beginning of a subexpression, though, as
|
||||
@acronym{POSIX} allows implementations that treat @code{^} as
|
||||
an ordinary character in that context.
|
||||
Matches the null string at beginning of the pattern space, i.e. what
|
||||
appears after the circumflex must appear at the beginning of the
|
||||
pattern space.
|
||||
|
||||
In most scripts, pattern space is initialized to the content of each
|
||||
line (@pxref{Execution Cycle, , How @code{sed} works}). So, it is a
|
||||
useful simplification to think of @code{^#include} as matching only
|
||||
lines where @samp{#include} is the first thing on line---if there are
|
||||
spaces before, for example, the match fails. This simplification is
|
||||
valid as long as the original content of pattern space is not modified,
|
||||
for example with an @code{s} command.
|
||||
|
||||
@code{^} acts as a special character only at the beginning of the
|
||||
regular expression or subexpression (that is, after @code{\(} or
|
||||
@code{\|}). Portable scripts should avoid @code{^} at the beginning of
|
||||
a subexpression, though, as @acronym{POSIX} allows implementations that
|
||||
treat @code{^} as an ordinary character in that context.
|
||||
|
||||
@item $
|
||||
It is the same as @code{^}, but refers to end of line.
|
||||
It is the same as @code{^}, but refers to end of pattern space.
|
||||
@code{$} also acts as a special character only at the end
|
||||
of the regular expression or subexpression (that is, before @code{\)}
|
||||
or @code{\|}), and its use at the end of a subexpression is not
|
||||
|
||||
+19
-13
@@ -211,7 +211,8 @@ then exit.
|
||||
@opindex --silent
|
||||
@cindex Disabling autoprint, from command line
|
||||
By default, @command{sed} prints out the pattern space
|
||||
at the end of each cycle through the script.
|
||||
at the end of each cycle through the script (@pxref{Execution Cycle, ,
|
||||
How @code{sed} works}).
|
||||
These options disable this automatic printing,
|
||||
and @command{sed} only produces output when explicitly told to
|
||||
via the @code{p} command.
|
||||
@@ -716,21 +717,26 @@ Use back references (see below).
|
||||
Matches any character, including newline.
|
||||
|
||||
@item ^
|
||||
Matches the null string at beginning of line, i.e. what
|
||||
appears after the circumflex must appear at the
|
||||
beginning of line. @code{^#include} will match only
|
||||
lines where @samp{#include} is the first thing on line---if
|
||||
there are spaces before, for example, the match fails.
|
||||
@code{^} acts as a special character only at the beginning
|
||||
of the regular expression or subexpression (that is,
|
||||
after @code{\(} or @code{\|}). Portable scripts should avoid
|
||||
@code{^} at the beginning of a subexpression, though, as
|
||||
@acronym{POSIX} allows implementations that treat @code{^} as
|
||||
an ordinary character in that context.
|
||||
Matches the null string at beginning of the pattern space, i.e. what
|
||||
appears after the circumflex must appear at the beginning of the
|
||||
pattern space.
|
||||
|
||||
In most scripts, pattern space is initialized to the content of each
|
||||
line (@pxref{Execution Cycle, , How @code{sed} works}). So, it is a
|
||||
useful simplification to think of @code{^#include} as matching only
|
||||
lines where @samp{#include} is the first thing on line---if there are
|
||||
spaces before, for example, the match fails. This simplification is
|
||||
valid as long as the original content of pattern space is not modified,
|
||||
for example with an @code{s} command.
|
||||
|
||||
@code{^} acts as a special character only at the beginning of the
|
||||
regular expression or subexpression (that is, after @code{\(} or
|
||||
@code{\|}). Portable scripts should avoid @code{^} at the beginning of
|
||||
a subexpression, though, as @acronym{POSIX} allows implementations that
|
||||
treat @code{^} as an ordinary character in that context.
|
||||
|
||||
@item $
|
||||
It is the same as @code{^}, but refers to end of line.
|
||||
It is the same as @code{^}, but refers to end of pattern space.
|
||||
@code{$} also acts as a special character only at the end
|
||||
of the regular expression or subexpression (that is, before @code{\)}
|
||||
or @code{\|}), and its use at the end of a subexpression is not
|
||||
|
||||
Reference in new issue
Block a user