-----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 | to the extent desirable for the 3.1 of Bering. | I know for certain that this disturbs the validation | I have implemented for Webconf, but those of you who | rely on regular expressions in other subsystems of | Bering ought to read the following exposition. | | The problem is that the regex handling in Busybox | cannot correctly resolve repetitions using "\{n\}". | The following is a reduction of the actual case | that disturbs my validation of ip-addresses inside | /var/webconf/lib/validator.sh. | | firewall# ### Matches exactly {0,...,25} | firewall# tjugufem="\(1\?[0-9]\|2[0-5]\)" | firewall# ### Should match "n-m-k", where n,m,k in {0,...,25} | firewall# Trenne="$tjugufem\(-$tjugufem\)\{2\}" | firewall# | firewall# echo "25-19-25" | grep "^$Trenne$" | 25-19-25 | firewall# echo "25-20-25" | grep "^$Trenne$" | firewall#
Can you provide the exact sed code you're working with? I don't have the validator.sh code handy to examine directly. 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 standard regex). To gnu sed, the above and below are identical, but they might not be to busybox. Try the following, as an extended expression (ie: egrep or sed -r), and see if it's still buggy: ~ egrep '^(1?[0-9]|2[0-5])(-(1?[0-9]|2[0-5])){2}$' ...and try changing the location of the iterator to the first regex: ~ egrep '^((1?[0-9]|2[0-5])-){2}(1?[0-9]|2[0-5])$' Minor glitches like this are why the old (2.2 based kernel) releases used the 'real' sed. :) - -- Charles Steinkuehler [EMAIL PROTECTED] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFHx5RWLywbqEHdNFwRAv19AJoD+CGhagwaUQOEGKuDlDCQGFAI3ACgidZ+ QPHg8StqqnhqHq1SE2GKwtA= =Q51A -----END PGP SIGNATURE----- ------------------------------------------------------------------------- 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