delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2002/07/12/12:24:05

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sources.redhat.com/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
Message-Id: <5.1.0.14.2.20020712092005.02b97de8@pop3.cris.com>
X-Sender: rrschulz AT pop3 DOT cris DOT com
Date: Fri, 12 Jul 2002 09:25:09 -0700
To: "Glen Cordrey" <gcordrey AT convera DOT com>, <cygwin AT cygwin DOT com>
From: Randall R Schulz <rrschulz AT cris DOT com>
Subject: Re: find -regex not working?
In-Reply-To: <404A59F91E3673418CA27CD122E70F48DF370C@mdpo.convera.com>
Mime-Version: 1.0

Glen,


[ Non-Cygwin-specific question and answer. ]


If you want shell-style (a.k.a., "glob") patterns, use find's "-name" or 
"-iname" options. When you use "-regexp" you need to use full regular 
expressions such as those used by "grep," "egrep," "sed," or Perl.


To get the effect you want, one of these commands is called for:

         find -name "MyFile*"

or

         find -regex "MyFile.*"


Randall Schulz
Mountain View, CA USA


At 09:10 2002-07-12, Glen Cordrey wrote:
>If I understand the find man page, the -regex option isn't working for me.
>
>find -regex 'MyFile.java'
>
>lists the file, but
>
>find -regex 'MyFile*'
>
>doesn't. Am I specifying the regular expression correctly? If so, what 
>else do I need to do for this to work?
>
>Glen Cordrey


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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