GNU bug report logs - #22943
sed: + intepreted twice

Previous Next

Package: sed;

Reported by: "Dam, Jesse van" <jesse.vandam <at> wur.nl>

Date: Tue, 8 Mar 2016 16:33:02 UTC

Severity: normal

Tags: notabug

Done: Assaf Gordon <assafgordon <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: "Dam, Jesse van" <jesse.vandam <at> wur.nl>
To: 22943 <at> debbugs.gnu.org
Subject: bug#22943: sed: + intepreted twice
Date: Tue, 8 Mar 2016 12:06:43 +0000
Hi,


The plus sign in the following sed command is interpreted twice. One time for '1 or more occurrences' and one time as match a plus sign. I think this is incorrect behavior. Correct me if I am wrong.


echo '+710+1869' | sed 's/\(.[0-9]+\).*/\1/g'

Results in

+710+

Expected result

+710


Version: sed (GNU sed) 4.2.2


Thanks,

Jesse van dam







This bug report was last modified 8 years and 178 days ago.

Previous Next


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