bug-gnu-utils
[Top][All Lists]
Advanced

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

sed bug grouping


From: William Roeder
Subject: sed bug grouping
Date: Sun, 25 May 2014 10:17:24 -0400
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0

Html/pdf docs () for 1) for postfix operators, like \(abcd\)* and 2) back references. The problem is when using *both*.
echo 12345ab|sed -r "s/^([^a]{3})*(a)/<\1><\2>/"
12345ab
does not match as expected

echo 123456ab|sed -r "s/^([^a]{3})*(a)/<\1><\2>/"
<456><a>b
expected <123456><a>b

adding a second grouping is a work around
echo 123456ab|sed -r "s/^(([^a]{3})*)(a)/<\1><\3>/"
<123456><a>b
>echo 123456a123ab|sed -r "s/(([^a]{3})*)(a)/<\1><\3>/g"
<123456><a><123><a>b

C:\Users\Bill>sed --version
GNU sed version 4.2.1
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE,
to the extent permitted by law.

GNU sed home page: <http://www.gnu.org/software/sed/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
E-mail bug reports to: <address@hidden>.
Be sure to include the word ``sed'' somewhere in the ``Subject:'' field.

The address@hidden address is in the pdf chapter 7 so I cc'ed there.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]