bugfindutils - Bugs: bug #13495, repetition operator syntax changed...

 
 

bug #13495: repetition operator syntax changed in 4.2.21

Submitter:  Andreas Metzler <ametzler>
Submitted:  Tue 21 Jun 2005 05:40:13 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Fixed
Privacy:  Public Assigned to:  jay
Originator Name:  Open/Closed:  Closed
Release:  4.2.23 Fixed Release:  4.2.24
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 29 Jul 2005 10:25:19 PM UTC, comment #5: 

Default regex syntax now as for Emacs except that . matches a newline.  The Texinfo documentation describes the regex handling in detail now.

James Youngman <jay>
Group administrator
Sun 03 Jul 2005 03:21:04 PM UTC, comment #4: 

What about newlines - it seems logical to treat newlines no differently to other characters.  After all, newlines are treated specially in text files as they are the line terminators.  This not the case for filenames.

James Youngman <jay>
Group administrator
Sun 03 Jul 2005 02:58:45 PM UTC, comment #3: 

OK, I've been reworking the code to use RE_SYNTAX_EMACS by default. 

I've hit a temporary stumbling block however; I have discovered that "find -iregex" doesn't work on systems which need to use gnulib's regex.c implementation.  On the affected systems, "-iregex" is case sensitive (like -regex).

Systems with re_search() in their C library (such as GNU/Linux systems) are not affected by this problem.

James Youngman <jay>
Group administrator
Wed 22 Jun 2005 06:25:12 PM UTC, comment #2: 

I like the patch, but would prefer to switch back to RE_SYNTAX_EMACS as default, which is afaict what find up to 4.2.20 used.

I've thought a little bit about this and have realized that breaking backwards compability could be very painful. (Breaking lots of scripts in non-obvious ways, e.g  http://bugs.debian.org/315136)

thanks, cu andreas

Anonymous
Tue 21 Jun 2005 07:35:41 PM UTC, comment #1: 

This is the kind of issue on which most people don't have particularly strong views, but it's difficult to establish a consensus for one particular course of aciton.

I suggest that by default we use POSIX basic regular expressions and allow the user to select an alternative by the use of a positional option, -regextype. 


This is implemented in the attached patch, which I have not yet checked in.  This change applies to "find" but not to "locate".

Feedback appreciated.   If feedback is positive or nonexistent, I will apply this patch in about a week.

James Youngman <jay>
Group administrator
Tue 21 Jun 2005 05:40:13 PM UTC, original submission:  

This is no bug-port but a request for discussion.

touch a0 b

now try to search for files with a name ending in a number (i.e. a0). With 4.2.2[123] you'll need to use
find . -regex '.*[0-9]\+'

with earlier versions you'll need
find . -regex '.*[0-9]+'

This breaks backwards compability but OTOH the new syntax (requiring \+) matches GNU grep behavior.

Basic regex seem to be painful, glibc claims to support "POSIX regex functions" but the basic regexes it actually implements match neither the definition given in regex.7 (claiming to document POSIX 1003.2) nor the online available IEEE Std 1003.1, 2004 Edition. (A implementaion of POSIX re e.g. would not be allowed to support \|)

Andreas Metzler <ametzler>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #3112:  findutils-regextype.patch added by jay (10KiB - text/x-patch - Initial -regextype patch for find command)

 

Digest:
   bug dependencies.

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 8 latest changes.

Date Changed by Updated Field Previous Value => Replaced by
2005-07-29 jay StatusIn Progress Fixed
    Open/ClosedOpen Closed
    Fixed ReleaseNone 4.2.24
2005-07-29 jay Item GroupNone Wrong result
2005-07-06 jay Dependencies- Depends on bugs #13615
2005-06-21 jay StatusNone In Progress
    Assigned toNone jay
    Attached File- Added findutils-regextype.patch, #2620

Back to the top

Powered by Savane 3.13-caa5.
Corresponding source code