X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.1 required=5.0 tests=BAYES_05 X-Spam-Check-By: sourceware.org Message-ID: <4B0C5B65.7080401@cs.umass.edu> Date: Tue, 24 Nov 2009 17:17:09 -0500 From: Eliot Moss User-Agent: Thunderbird 2.0.0.23 (Windows/20090812) MIME-Version: 1.0 To: cygwin AT cygwin DOT com Subject: Re: Cygwin bash regexp matching doesn't treat "\b" properly References: <26500158 DOT post AT talk DOT nabble DOT com> <26500814 DOT post AT talk DOT nabble DOT com> <4B0C4C2A DOT 3080502 AT gmail DOT com> <26503748 DOT post AT talk DOT nabble DOT com> <408995400911241354p27f2c5eek94973673d24fa3b3 AT mail DOT gmail DOT com> <26504147 DOT post AT talk DOT nabble DOT com> In-Reply-To: <26504147.post@talk.nabble.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com 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