This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Fw: GNU sed: bug in repeated sub expression?
- From: "Bonzini" <bonzini at gnu dot org>
- To: <libc-alpha at sources dot redhat dot com>
- Cc: <lvl at club-internet dot fr>
- Date: Thu, 13 Mar 2003 22:27:38 +0100
- Subject: Fw: GNU sed: bug in repeated sub expression?
Here is a bug report I received. I think it would be wise to add
this test and XFAIL it:
> The POSIX RE page is quite clear about the fact that, in cases
> like '\(a*\)*' the sub-expression (i.e. 'a*') is not allowed to match the
> null string UNLESS it is required to let the outer-expression to
> match at all, or to reach the minimum repetition count in cases like
> '\(a*\)\{3,5\}'.
>
> All this to say that, if I understand it correctly, the following
> expression:
> echo abcd | sed 's/\(a*\)*/<\&=&,\\1=\1>/'
> should give:
> <&=a;\1=a>bcd
> instead of what is currently produced by GNU sed 4.0.5:
> <&=a;\1=>bcd
> and similarly:
> echo aba,ab,a | sed 's/\(a*b*\)\{1,2\}/<\&=&,\\1=\1>/g'
> should give:
> <&=aba;\1=a>,<&=ab;\1=ab>,<&=a;\1=a>
> instead of what GNU sed currently yields.
Paolo
ps: Jakub, I'll release shortly 4.0.6 which has --with-included-regex