Hello Charles Steinkuehler,

tor 2008-02-28 klockan 23:12 -0600 skrev Charles Steinkuehler:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Mats Erik Andersson wrote:
> | Hi folks,
> |
> | this is preliminary information that Busybox does
> | not possess a full command of regular expression
> ...
> Can you provide the exact sed code you're working with?  I don't have
> the validator.sh code handy to examine directly.
> 
This is not essential! Instead try the code snippet below.

> It looks like the regular expression you're passing to grep is:
> 
> ~  $ echo "^$Trenne$"
> ~  ^\(1\?[0-9]\|2[0-5]\)\(-\(1\?[0-9]\|2[0-5]\)\)\{2\}$
> 
> For portability I would suggest directly crafting an extended regular
> expression (rather than escaping all the extended metacharacters in a
> ...
> Minor glitches like this are why the old (2.2 based kernel) releases
> used the 'real' sed.  :)
> 
> - --
> Charles Steinkuehler
> [EMAIL PROTECTED]

I have step by step narrowed the cause of failure.
It turns out that uClibc cannot handle the desired
regular expression. This is the case for 0.9.28
(on Bering-C and ATNGW100/avr32), and since the
relevant codebase has been untouched for quite
some time, I expect the same thing to hold for
uClibc 0.9.29.

After experimentation a minimal test is a follows:

#### CODE ####
#!/bin/sh

lager=/tmp/tillf

{
echo -e "abab\nbaab\nabba" | egrep '^(a?[ab]|ba){2}$'
echo -e "abab\nbaab\nabba" | egrep '^(ba|a?[ab]){2}$'
} > $lager # | tee $lager

echo "$(wc -l < $lager) matches out of intended 6."
cat $lager
rm $lager
#### END OF CODE ####

The intended six matches appear on a GNU-system
and on OpenBSD, but only five matches appear on
Bering-uC 3.1 and a uC-0.9.28-based avr32-system.
The problem lies in '?' preceeding '|', but not
the other way around.

Regards

Mats E Andersson


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

_______________________________________________
leaf-devel mailing list
leaf-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/leaf-devel

Reply via email to