LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
Email to...
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] listing files

[ILUG] listing files

kevin lyda kevin at suberic.net
Mon Jul 16 12:46:09 IST 2001


On Mon, Jul 16, 2001 at 12:28:23PM +0100, Colm Buckley wrote:
> No, no.

correct, i was over-simplifying.

> Two misconceptions here.
> 
> First of all, '*' in a regular expression doesn't mean "any sequence
> of characters", it means "zero or more instances of the previous
> item", so in a *regular expression* context, "foo*[^re]c" would match
> a (sub)string starting with "fo", then any number of "o"s, then any
> character except "r" and "e", and finally a "c".

in globbing * means any sequence of chars - it's shorthand for the
regexp .* .  the main point was what [^re] meant - not the same
thing as [^r][^e]|r[^e]|[^r]e (surely there's an easier way to write
"not a string").  in a glob context the only thing that changes is
s/fo"/foo"/;s/"o"/char/

> *If* it's only files ending in "ec" which you want to exclude, you
> could do "*[^e]c", which would give you all files ending in "c" except
> those where the second last letter is "e"; this is a bit flaky,
> though, as it relies on previous knowledge of the space of filenames.

right.  this would miss fooc.

kevin

-- 
kevin at suberic.net          "linux is a cancer"  --steve ballmer
fork()'ed on 37058400      "released 25 august 1991, linux is a virgo" --me
meatspace place: home       linux, not just a star-sign:
http://suberic.net/~kevin                             http://www.linux.com/




More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell