Dear Eric, I will leave all your code for reference, and add one more for OpenBSD. The really bad news is that uClibc (Berin 1.2/3.1) is assymmetric: five hits, where I went to efforts to construct symmetric test cases. As for AIX, the answer is symmetric, but could you possible test a deeper grouping of patterns:
echo -e "abab\nbaab\nabba" | egrep '^((a?[ab])|ba){2}$' echo -e "abab\nbaab\nabba" | egrep '^(ba|(a?[ab])){2}$' This additional depth does not change anything to GNU-regex, but fits perfectly with the point where AIX failed. Does anyone have access to a Solaris system? Regards Mats E A >>>>>>>>>>>>>>>>>>>>>>>>>>>> on OpenBSD 4.2 >>>>>>>>>>>>>>>>>>>>>>>>>>>> 6 matches out of intended 6. abab baab abba abab baab abba fre 2008-02-29 klockan 13:26 +0000 skrev Erich Titl: > Hi Mats > > Just out of curiosity I tested your code > > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > on AIX > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > # #!/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." > 4 matches out of intended 6. > # cat $lager > baab > abba > baab > abba > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > On a SuSE 10.0 > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > [EMAIL PROTECTED]:~> echo "$(wc -l < $lager) matches out of intended 6." > 6 matches out of intended 6. > [EMAIL PROTECTED]:~> cat $lager > abab > baab > abba > abab > baab > abba > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > On Bering 1.2 > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > greatwall: -root- > # echo "$(wc -l < $lager) matches out of intended 6." > 5 matches out of intended 6. > > greatwall: -root- > # cat $lager > abab > abba > abab > baab > abba > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > On Bering 3.x > >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> > gatekeeper# #!/bin/sh > gatekeeper# > gatekeeper# lager=/tmp/tillf > gatekeeper# > gatekeeper# { > > echo -e "abab\nbaab\nabba" | egrep '^(a?[ab]|ba){2}$' > > echo -e "abab\nbaab\nabba" | egrep '^(ba|a?[ab]){2}$' > > } > $lager # | tee $lager > gatekeeper# > gatekeeper# echo "$(wc -l < $lager) matches out of intended 6." > 5 matches out of intended 6. > gatekeeper# cat $lager > abab > abba > abab > baab > abba > > In this selection the only system which interprets your code 'right' is > a fully blown linux. Mind you, Bering 1.2 has a sed binary as does AIX. > > I guess your code is not very portable then :-( > > cheers > > Erich > ------------------------------------------------------------------------- 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