bug-findutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug #31933] Wrong results with negated -regex


From: James Youngman
Subject: [bug #31933] Wrong results with negated -regex
Date: Sun, 19 Dec 2010 22:34:55 +0000
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US) AppleWebKit/534.10 (KHTML, like Gecko) Chrome/8.0.552.224 Safari/534.10

Update of bug #31933 (project findutils):

                  Status:                    None => Invalid                
             Open/Closed:                    Open => Closed                 

    _______________________________________________________

Follow-up Comment #1:

Your start point was ".".   Hence all paths considered by find will be of the
form "./" followed by something else.   In other words they will match the
regular expression './.*'.  However, the regular expression you specified was 
'.(css|png|gif)$' and that only matches filenames which have 'c', 'p' or 'g'
in the second position.  Since all filenames considered by find in this
example have '/' in that position, no file names match the specified regex.  
It's negated, so the negated expression is always true and hence find will
find all files.

I think you probably just misunderstood what -regex matches on:


$ PAGER="grep -A2 -e '-regex '" man find
       -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


    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?31933>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]