Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.bash.bug > #16112 > unrolled thread

Error in the manual regarding the '=~' operator

Started byGuebitz Roland <Roland.Guebitz@cardcenter.ch>
First post2020-04-09 11:19 +0000
Last post2020-04-09 11:19 +0000
Articles 1 — 1 participant

Back to article view | Back to gnu.bash.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Error in the manual regarding the '=~' operator Guebitz Roland <Roland.Guebitz@cardcenter.ch> - 2020-04-09 11:19 +0000

#16112 — Error in the manual regarding the '=~' operator

FromGuebitz Roland <Roland.Guebitz@cardcenter.ch>
Date2020-04-09 11:19 +0000
SubjectError in the manual regarding the '=~' operator
Message-ID<mailman.404.1586438131.2644.bug-bash@gnu.org>
Hello,
in the section
https://www.gnu.org/software/bash/manual/bash.html#Conditional-Constructs
you have this example:
[[ $line =~ [[:space:]]*?(a)b ]]
The expression ?() is not part of the Posix ERE. It is part of bash pattern matching: https://www.gnu.org/software/bash/manual/bash.html#Pattern-Matching
Consider this example, which will not match:
line="aaab"
echo $line
if [[ $line =~ '?(a)b' ]]; then
echo Match
echo ${BASH_REMATCH[0]}
echo ${BASH_REMATCH[1]}
else
echo No match
fi
Kind regards,
Roland



Based on previous e-mail correspondence with you and/or an agreement reached with you, we consider ourselves authorized to contact you via unsecured e-mail.

Warning:

(a) E-mails can involve SUBSTANTIAL RISKS, e.g. lack of confidentiality, potential manipulation of contents and/or sender's address, incorrect recipient (misdirection), viruses etc. We assume no responsibility for any loss or damage resulting from the use of e-mails. We recommend in particular that you do NOT SEND ANY SENSITIVE INFORMATION, that you do not include details of the previous message in any reply, and that you enter e-mail address(es) manually every time you write an e-mail.

(b) As a matter of principle, we do NOT accept any ORDERS, revocations of orders or authorizations, blocking of credit cards, etc., sent by e-mail. Should such an e-mail nevertheless be received, we are not obliged to act on or respond to the e-mail.

Please notify us immediately if you received this e-mail by mistake or if you do not wish to receive any further e-mail correspondence. If you have received this e-mail by mistake, please completely delete it (and any attachments) and do not forward it or inform any other person of its contents.

[toc] | [standalone]


Back to top | Article view | gnu.bash.bug


csiph-web