bugfindutils - Bugs: bug #12999, find "-regex" doesn't...

 
 

bug #12999: find "-regex" doesn't honor "bounds"

Submitter:  Alexander Skwar <askwar>
Submitted:  Fri 06 May 2005 05:13:33 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Alexander Skwar Open/Closed:  Closed
Release:  4.2.20 Fixed Release:  4.2.21
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 07 Jun 2005 11:37:19 PM UTC, comment #3: 

You can download a release of findutils in which this problem is
fixed from ftp://alpha.gnu.org/gnu/findutils.

The releases on alpha.gnu.org are for testing purposes, so please
take the time to download the release and verify that your
problem has been solved.  Once the release has been sufficiently
tested, it can be uploaded to ftp.gnu.org for everybody to use it.

James Youngman <jay>
Group administrator
Mon 09 May 2005 07:45:27 PM UTC, comment #2: 

This problem is fixed in the CVS code for findutils.
To resolve your problem, you could either wait for the
next official release of findutils, or check out a copy
of the code from the CVS repository for findutils.

James Youngman <jay>
Group administrator
Mon 09 May 2005 07:44:54 PM UTC, comment #1: 

It turns out to be due to the fact that the regexp syntax was not correctly initialised.  It is now set to RE_SYNTAX_POSIX_BASIC in find/parser.c, which means that intervals are provided:

$ ./find . -regex '.*fstype.o\{1\}' -print
./fstype.o

James Youngman <jay>
Group administrator
Fri 06 May 2005 05:13:33 PM UTC, original submission:  

[19:01:24 alexander@server:~/tmp/muell/finde] $ ls -la
insgesamt 4
drwxr-xr-x  2 alexander alexander  116  3. Mai 16:24 .
drwxr-xr-x  8 alexander alexander 4096  3. Mai 16:16 ..
-rw-r--r--  1 alexander alexander    0  3. Mai 16:21 ab0{3}cd
-rw-r--r--  1 alexander alexander    0  3. Mai 16:16 ab12345cd
-rw-r--r--  1 alexander alexander    0  3. Mai 16:16 ab1234cd
-rw-r--r--  1 alexander alexander    0  3. Mai 16:16 ab123cd
-rw-r--r--  1 alexander alexander    0  3. Mai 16:18 ab9cd
-rw-r--r--  1 alexander alexander    0  3. Mai 16:19 ab_cd
-rw-r--r--  1 alexander alexander    0  3. Mai 16:20 ab.cd
-rw-r--r--  1 alexander alexander    0  3. Mai 16:24 FOab9cd

I'm trying to find all the files in this directory whose names are starting with "ab", ending with "cd" and have between 4 and 5 digits between them. One way to do this, would be the following regex:

   ab[0-9]{4,5}cd

So I tried:

[19:04:49 alexander@server:~/tmp/muell/finde] $ find . -regex './ab[0-9]{4,5}cd'
[19:04:54 alexander@server:~/tmp/muell/finde] $ find . -regex './ab[0-9]\{4,5\}cd'
[19:04:57 alexander@server:~/tmp/muell/finde] $

The find man page states, that "basic" re should be supported. If so, then the RE is correct - testing it with grep shows, that it is indeed correct:

[19:08:12 alexander@server:~/tmp/muell/finde] $ find . | grep './ab[0-9]\{4,5\}cd'
./ab12345cd
./ab1234cd


Why are the bounds in the RE not honored?

Alexander Skwar <askwar>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

Only logged-in users can vote.

 

Follow 6 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-06-07 jay Open/ClosedOpen Closed
    Fixed ReleaseNone 4.2.21
2005-05-09 jay Item GroupNone Wrong result
    StatusNone Fixed
    Assigned toNone jay
2005-05-06 askwar Carbon-Copy- Added -email is unavailable-

Back to the top

Powered by Savane 3.12.
Corresponding source code