Re: 1.5, 1.7: Bash regex not recognizing word boundaries

2009-10-20 Thread Allen Halsey
On Mon, Oct 19, 2009 at 3:30 PM, Eric Blake wrote: > > Indeed - \b is a GNU extension available in glibc's regcomp(), but not > required by POSIX nor available in newlib.  Unless/until someone > contributes patches to write the same extensions to the POSIX interface, > then bash won't be able to m

Re: 1.5, 1.7: Bash regex not recognizing word boundaries

2009-10-19 Thread Eric Blake
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 According to Mark J. Reed on 10/19/2009 6:34 PM: > On Mon, Oct 19, 2009 at 4:50 PM, Allen Halsey wrote: > These should print "Matched", but they don't: > > $ REGEX='\bcat\b' > $ [[ "dog cat bird" =~ $REGEX ]] && echo "Matched" > $ REGEX='\' > $ [[ "do

Re: 1.5, 1.7: Bash regex not recognizing word boundaries

2009-10-19 Thread Mark J. Reed
On Mon, Oct 19, 2009 at 4:50 PM, Allen Halsey wrote: These should print "Matched", but they don't: $ REGEX='\bcat\b' $ [[ "dog cat bird" =~ $REGEX ]] && echo "Matched" $ REGEX='\' $ [[ "dog cat bird" =~ $REGEX ]] && echo "Matched" It's worth noting that this is not limited to Cygwin; I'm seeing t

1.5, 1.7: Bash regex not recognizing word boundaries

2009-10-19 Thread Allen Halsey
These should print "Matched", but they don't: $ REGEX='\bcat\b' $ [[ "dog cat bird" =~ $REGEX ]] && echo "Matched" $ REGEX='\' $ [[ "dog cat bird" =~ $REGEX ]] && echo "Matched" $ egrep works as expected: $ egrep -q '\bcat\b' <(echo "dog cat bird") && echo "Matched" Matched $ egrep -q '\' <(echo