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

 
 

bug #13495: repetition operator syntax changed in 4.2.21

Submitted by:  Andreas Metzler <ametzler>
Submitted on:  Tue 21 Jun 2005 05:40:13 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: Fixed
Privacy: PublicAssigned to: James Youngman <jay>
Originator Name: Open/Closed: Closed
Release: 4.2.23Fixed Release: 4.2.24

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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>
Project AdministratorIn charge of this item.
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 File(s):
   
   
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

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 8 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Fri 29 Jul 2005 10:25:19 PM UTCjayStatusIn Progress=>Fixed
  Open/ClosedOpen=>Closed
  Fixed ReleaseNone=>4.2.24
Fri 29 Jul 2005 10:25:18 PM UTCjayItem GroupNone=>Wrong result
Wed 06 Jul 2005 10:04:13 PM UTCjayDependencies-=>Depends on bugs #13615
Tue 21 Jun 2005 07:35:41 PM UTCjayStatusNone=>In Progress
  Assigned toNone=>jay
  Attached File-=>Added findutils-regextype.patch, #2620

Back to the top


Powered by Savane 3.1-cleanup1