Cygwin bash regexp matching doesn't treat "\b" properly

Eliot Moss moss@cs.umass.edu
Wed Nov 25 14:46:00 GMT 2009


What I have often done in a case like this is:

Add the separator (space in this case) at each end of the list.
So, if the initial string is "101 203 455" I turn that into
" 101 203 455 ".

LIST=" ${LIST} "

Then I match the desired string, also surrounded by spaces,
like this:

[ -z "${LIST##* ${DESIRED} *}" ] && { ... }

This uses simple bash globbing stuff that seems to work
everywhere. It's an idiom I've become accustomed to :-) ...

Regards -- Eliot Moss

--
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



More information about the Cygwin mailing list