Subject: lib/34560: Basic regexes do not match correctly when combining bound and backref
To: None <lib-bug-people@netbsd.org, gnats-admin@netbsd.org,>
From: None <Peter.Bex@xs4all.nl>
List: netbsd-bugs
Date: 09/19/2006 20:05:01
>Number:         34560
>Category:       lib
>Synopsis:       Basic regexes go wrong when combining bound and backref
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    lib-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Sep 19 20:05:01 +0000 2006
>Originator:     Peter Bex
>Release:        NetBSD 3.0.0_STABLE
>Organization:
	
>Environment:
	
	
System: NetBSD frohike.homeunix.org 3.0.0_STABLE NetBSD 3.0.0_STABLE (FROHIKE) #0: Thu May 25 14:15:21 CEST 2006 sjamaan@frohike.homeunix.org:/usr/src/sys/arch/amd64/compile/FROHIKE amd64
Architecture: x86_64
Machine: amd64
>Description:
	According to the documentation, the following basic regex:
	$ echo "axxxa" | sed "s/\(a\)x\{1,3\}\1/foo/"
	should result in:
	foo
	but it results in:
	axxxa

	What does work (ie, results in 'foo') is this:
	$ echo "axxxa" | sed "s/\(a\)x\{3,3\}\1/foo/"
	or this (backref only, no bound):
	$ echo "axxxa" | sed "s/\(a\)xxx\1/foo/"
	or this (bound only, no backref):
	$ echo "axxxa" | sed "s/\(a\)x\{1,3\}/foo/"
>How-To-Repeat:
	Just enter the sed commands and see for yourself.
>Fix:

>Unformatted: