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] find regex question

[ILUG] find regex question

Stephen Shirley diamond at skynet.ie
Tue Jun 18 17:13:46 IST 2002


On Tue, Jun 18, 2002 at 04:41:23PM +0100, Justin MacCarthy wrote:
> find /  -iregex
> '^[a-z0-9]\{8\}\-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{4\}-[a-z0-9]\{12\}\.*
> $'

Right, 3 things. First, from the man page:

       -regex pattern
              File name matches regular expression pattern.  This
              is a match on the whole path, not  a  search.   For
              example,  to match a file named `./fubar3', you can
              use the regular expression  `.*bar.'  or  `.*b.*3',
              but not `b.*r3'.

so the ^ at the start has to change to ^[^\/]*\/
Secondly, you've got a typo there; ^[a-z0-9]\{8\}\-. The - shouldn't be escaped.
Thridly, i don't think find accepts the pattern{n} method, or at least, not
that i can see.

Steve
-- 
"Oh look, it's the Pigeon of Love."




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