sed bug ?
Rostislav
rostislav at tuxera.com
Thu Nov 17 13:48:40 UTC 2016
Hello Timo,
I have seen this problem with Musl basic regular expressions myself. Busybox sed uses C library's regex functions (regcomp, regexec, etc), and Musl versions < 1.1.13 do not support \|, \+ and \? in basic regular expressions. See Musl's changelog here http://git.musl-libc.org/cgit/musl/tree/WHATSNEW , in 1.1.13 release notes it says under "new features":
- regex BRE extensions: \|, \+, \?
The same happens with e. g. busybox grep and other tools that rely on C library's regex functions. Therefore I would prefer to use extended regexes instead.
Best regards,
Rostislav
> On Nov 17, 2016, at 11:56 AM, Timo Teras <timo.teras at iki.fi> wrote:
>
> Hi,
>
> The following discrepancy happens on 1.25.1 (and git master) with musl
> c-library:
>
> ~ $ echo /usr/lib/ | sed 's,\(^/\|\)[^/][^/]*,..,g'
> ../../
>
> ~ $ echo /usr/lib/ | busybox sed 's,\(^/\|\)[^/][^/]*,..,g'
> /../../
>
> Any thoughts?
>
> Thanks,
> Timo
>
More information about the busybox
mailing list