This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: 1.5, 1.7: Bash regex not recognizing word boundaries
- From: "Mark J. Reed" <markjreed at gmail dot com>
- To: cygwin at cygwin dot com
- Date: Mon, 19 Oct 2009 20:34:03 -0400
- Subject: Re: 1.5, 1.7: Bash regex not recognizing word boundaries
- References: <loom.20091019T224729-941@post.gmane.org>
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='\<cat\>'
$ [[ "dog cat bird" =~ $REGEX ]] && echo "Matched"
It's worth noting that this is not limited to Cygwin; I'm seeing the
same behavior on OS X (with the same version of bash as my Linux
system where the above works as intended). I suspect it's a factor
of the regex library used to build bash rather than bash itself.
--
Problem reports: http://cygwin.com/problems.html
FAQ: http://cygwin.com/faq/
Documentation: http://cygwin.com/docs.html
Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple