[BusyBox] expr: use POSIX regex [PATCH]

Shaun Jackman sjackman at gmail.com
Tue Apr 5 19:51:08 UTC 2005


On Apr 5, 2005 10:15 AM, Rob Landley <rob at landley.net> wrote:
> On Tuesday 05 April 2005 01:48 pm, Shaun Jackman wrote:
> > This patch modfies expr to use portable POSIX regex rather than BSD regex.
> 
> Sounds cool.  Is there a functional difference, or is this just syntax?  (I
> suspect that in uclibc both are wrappers over the same functionality, but
> haven't confirmed it.)
> 
> I just checked, and sed.c is using the posix regex already...
> 
> Rob

I believe it's primarily a syntax difference. I just noticed though
that expr match behaves as if it has an implicit ^ before the regex,
i.e. it's an anchored regex. My patch doesn't behave like this:

$ expr match abcd bc
0
$ expr match abcd abc
3
$ ./busybox expr match abcd bc
2
$ ./busybox expr match abcd abc
3

If the former's the standard behaviour, it should be fixed first.

Cheers,
Shaun



More information about the busybox mailing list