NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: lib/57530: regex(3): REG_BADRPT raised by { for REG_EXTENDED



The following reply was made to PR lib/57530; it has been noted by GNATS.

From: RVP <rvp%SDF.ORG@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: 
Subject: Re: lib/57530: regex(3): REG_BADRPT raised by { for REG_EXTENDED
Date: Tue, 18 Jul 2023 08:08:12 +0000 (UTC)

 On Tue, 18 Jul 2023, RVP wrote:
 
 > Ie. this is exactly the same as:
 >
 > ```
 > $ grep -E '*'
 > grep: repetition-operator operand invalid
 > $
 > ```
 >
 > I think we should amend the man-page.
 >
 
 I should've mentioned that the grep(1) used above was the one in FreeBSD-13.2
 (which uses the libc regexp(3) as its engine.).
 
 GNU grep 3.11 does:
 
 ```
 $ /opt/gnu/bin/grep --version
 grep (GNU grep) 3.11
 Copyright (C) 2023 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later 
 <https://gnu.org/licenses/gpl.html>.
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.
 
 Written by Mike Haertel and others; see
 <https://git.savannah.gnu.org/cgit/grep.git/tree/AUTHORS>.
 
 grep -P uses PCRE2 10.42 2022-12-11
 
 $ env POSIXLY_CORRECT=true /opt/gnu/bin/grep -E '*' </dev/null
 grep: warning: * at start of expression
 
 $ env POSIXLY_CORRECT=true /opt/gnu/bin/grep -E '+' </dev/null
 grep: warning: + at start of expression
 
 $ env POSIXLY_CORRECT=true /opt/gnu/bin/grep -E '?' </dev/null
 grep: warning: ? at start of expression
 
 $
 ```
 
 except:
 
 ```
 $ env POSIXLY_CORRECT=true /opt/gnu/bin/grep -E '{' </dev/null
 $
 ```
 
 which behaves differently for some reason...
 
 -RVP
 


Home | Main Index | Thread Index | Old Index