commit bash-20190923 snapshot

This commit is contained in:
Chet Ramey
2019-09-24 11:44:31 -04:00
parent d111b2af6e
commit 31d704c98d
2 changed files with 24 additions and 9 deletions
+15 -6
View File
@@ -759,16 +759,25 @@ Bracket expressions in regular expressions must be treated carefully,
since normal quoting characters lose their meanings between brackets.
If the pattern is stored in a shell variable, quoting the variable
expansion forces the entire pattern to be matched as a string.
Substrings matched by parenthesized subexpressions within the regular
expression are saved in the array variable
.if t .sp 0.5
.if n .sp 1
The pattern will match if it matches any part of the string.
Anchor the pattern using the \fB^\fP and \fB$\fP regular expression
operators to force it to match the entire string.
The array variable
.SM
.BR BASH_REMATCH .
.B BASH_REMATCH
records which parts of the string matched the pattern.
The element of
.SM
.B BASH_REMATCH
with index 0 is the portion of the string
matching the entire regular expression.
The element of
with index 0 contains the portion of
the string matching the entire regular expression.
Substrings matched by parenthesized subexpressions within the regular
expression are saved in the remaining
.SM
.B BASH_REMATCH
indices. The element of
.SM
.B BASH_REMATCH
with index \fIn\fP is the portion of the
+9 -3
View File
@@ -1049,10 +1049,16 @@ Bracket expressions in regular expressions must be treated carefully,
since normal quoting characters lose their meanings between brackets.
If the pattern is stored in a shell variable, quoting the variable
expansion forces the entire pattern to be matched as a string.
The pattern will match if it matches any part of the string.
Anchor the pattern using the @samp{^} and @samp{$} regular expression
operators to force it to match the entire string.
The array variable @code{BASH_REMATCH} records which parts of the string
matched the pattern.
The element of @code{BASH_REMATCH} with index 0 contains the portion of
the string matching the entire regular expression.
Substrings matched by parenthesized subexpressions within the regular
expression are saved in the array variable @code{BASH_REMATCH}.
The element of @code{BASH_REMATCH} with index 0 is the portion of the string
matching the entire regular expression.
expression are saved in the remaining @code{BASH_REMATCH} indices.
The element of @code{BASH_REMATCH} with index @var{n} is the portion of the
string matching the @var{n}th parenthesized subexpression.