X-Recipient: archive-cygwin AT delorie DOT com X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org MIME-Version: 1.0 In-Reply-To: References: Date: Mon, 19 Oct 2009 20:34:03 -0400 Message-ID: Subject: Re: 1.5, 1.7: Bash regex not recognizing word boundaries From: "Mark J. Reed" To: cygwin AT cygwin DOT com Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: 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 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 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