This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Cygwin bash regexp matching doesn't treat "\b" properly
aputerguy wrote:
> OK - I think I found the answer which is that \b is a GNU extension not
> recognized in cygwin.
>
> So, I guess the question now is there an alternative way of recognizing word
> boundaries?
Bash man page for '~=' refers to man regex(3) which refers to man regex(7)
which describes word boundary markers as below:
$ [[ "foo" =~ [[:\<:]]foo[[:\>:]] ]]; echo $?
0
$ [[ "foobar" =~ [[:\<:]]foo[[:\>:]] ]]; echo $?
1
$
(Note that I had to backslash-escape the < and > there. In other contexts
that might not be needed.)
cheers,
DaveK
--
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