GNU bug report logs - #73598
bug in sed Invalid preceding regular expression

Previous Next

Package: sed;

Reported by: Peter Smulders <p.j.m.smulders <at> home.nl>

Date: Wed, 2 Oct 2024 13:00:03 UTC

Severity: normal

Full log


Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Peter Smulders <p.j.m.smulders <at> home.nl>
To: bug-sed <at> gnu.org
Subject: bug in sed Invalid preceding regular expression
Date: Wed, 2 Oct 2024 11:59:09 +0200
I expect the command line

echo ****some string | sed s/\*\*\*\*//

to strip the *'s and result in

some string

However I get the error message:

sed: -e expression #1, char 8: Invalid preceding regular expression

-----

When the sed command is taken from a file it works as expected:

$ echo ****some string | sed -f script
some string

where file script consists of the line
s/\*\*\*\*//

---

The problem shows in:

$ sed --version
sed (GNU sed) 4.9
Copyright (C) 2022 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 Jay Fenlason, Tom Lord, Ken Pizzini,
Paolo Bonzini, Jim Meyering, and Assaf Gordon.

This sed program was built without SELinux support.

GNU sed home page: <https://www.gnu.org/software/sed/>.
General help using GNU software: <https://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-sed <at> gnu.org>.

----

an older version does not have this problem ( GNU sed version 3.02 )

best regards, Peter Smulders






This bug report was last modified 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.