GNU bug report logs -
#61399
Issue with the "egrep" command
Previous Next
To reply to this bug, email your comments to 61399 AT debbugs.gnu.org.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
bug-grep <at> gnu.org
:
bug#61399
; Package
grep
.
(Fri, 10 Feb 2023 08:07:02 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Liu Wilson <wilson810911 <at> hotmail.com>
:
New bug report received and forwarded. Copy sent to
bug-grep <at> gnu.org
.
(Fri, 10 Feb 2023 08:07:02 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello Developer,
I am writing this email regarding an issue with the command “egrep”, I wrote the following script and try to get a user to enter their postal code in the correct format, otherwise, it will not pass.
Please see picture1
As you can see, the format should be
[[:upper:]][[:digit:]][[:upper:]][[:space:]][[:digit:]][[:upper:]][[:digit:]]
I want to give the user an error if they enter more than one space, but it did not work.
Please see picture2
Still exit the while loop even if the user enters more than 1 space
I have tried the following, and it did not work as I expected:
'^[A-Z][0-9][A-Z] [0-9][A-Z][0-9]$'
'^[A-Z][0-9][A-Z]\s[0-9][A-Z][0-9]$'
'^[A-Z][0-9][A-Z][[:space:]][0-9][A-Z][0-9]$'
'^[A-Z][0-9][A-Z][[:space:]]{1}[0-9][A-Z][0-9]$'
I have tried to google many cases and looks like quite a bit of people having issues limiting the number of spaces that they want, so I am wondering if it is a bug.
What would be the correct way to limit users entering 1 space only?
I really appreciate your time to address this issue, hope you have a wonderful day.
Wilson.
[Message part 2 (text/html, inline)]
[picture1.png (image/png, attachment)]
[picture2.jpg (image/jpeg, attachment)]
This bug report was last modified 1 year and 322 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.