delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2009/11/25/10:34:23

X-Recipient: archive-cygwin AT delorie DOT 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 AT niaid DOT nih DOT gov>
To: "cygwin AT cygwin DOT com" <cygwin AT cygwin DOT com>, aputerguy <nabble AT kosowsky DOT 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 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>
MIME-Version: 1.0
X-IsSubscribed: yes
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT 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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019