X-Recipient: archive-cygwin@delorie.com
X-SWARE-Spam-Status: No, hits=-2.6 required=5.0 	tests=BAYES_00,SPF_PASS
X-Spam-Check-By: sourceware.org
X-IronPortListener: Outbound_SMTP
From: "Buchbinder, Barry (NIH/NIAID) [E]" <BBuchbinder@niaid.nih.gov>
To: "cygwin@cygwin.com" <cygwin@cygwin.com>, aputerguy <nabble@kosowsky.org>
Date: Wed, 25 Nov 2009 10:33:53 -0500
Subject: RE: Cygwin bash regexp matching doesn't treat "\b" properly
Message-ID: <0105D5C1E0353146B1B222348B0411A208A497494E@NIHMLBX02.nih.gov>
References: <26500158.post@talk.nabble.com> <26500814.post@talk.nabble.com>  <4B0C4C2A.3080502@gmail.com> <26503748.post@talk.nabble.com>  <408995400911241354p27f2c5eek94973673d24fa3b3@mail.gmail.com>  <26504147.post@talk.nabble.com>
In-Reply-To: <26504147.post@talk.nabble.com>
Content-Type: text/plain; charset="us-ascii"
Content-Transfer-Encoding: quoted-printable
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help@cygwin.com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe@cygwin.com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin@cygwin.com>
List-Help: <mailto:cygwin-help@cygwin.com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner@cygwin.com
Mail-Followup-To: cygwin@cygwin.com
Delivered-To: mailing list cygwin@cygwin.com

aputerguy sent the following at Tuesday, November 24, 2009 5:10 PM
>
> Seriously, there are times to use Perl and times not to... But launching
> perl seems a bit of overkill when I just have to do a simple match in a
>.bashrc script or when I need a small shell script wrapper.

Looking at the man page for everything in /bin that matches the pattern
*.exe find the following that may be of interest.  Testing to see if these
actually work is left as an exercise for the OP.  :-)

pcregrep - a grep with Perl-compatible regular expressions.

grep, egrep, fgrep - print lines matching a pattern
 -w, --word-regexp
        Select only those lines containing matches that form whole
        words.  The test is that the matching substring must either be
        at the beginning of the line, or preceded by a non-word
        constituent character.  Similarly, it must be either at the end
        of the line or followed by a non-word constituent character.
        Word-constituent characters are letters, digits, and the
        underscore.


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

