bugfindutils - Bugs: bug #30327, regex ranges [A-Z] and [a-z]...

 
 

bug #30327: regex ranges [A-Z] and [a-z] ignore case.

Submitter:  None
Submitted:  Fri 02 Jul 2010 04:01:40 PM UTC
   
 
Category:  find Severity:  3 - Normal
Item Group:  Wrong result Status:  Invalid
Privacy:  Public Assigned to:  ericb
Originator Name:  Alexandre de Verteuil Originator Email:  -email is unavailable-
Open/Closed:  Closed Release:  4.4.2
Fixed Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 02 Jul 2010 09:57:47 PM UTC, comment #2: 

Ah! Thank your for your time, good day!

Anonymous
Fri 02 Jul 2010 04:18:43 PM UTC, comment #1: 

Not a bug, but a function of your current locale.  For more details, see FAQ E9 in the bash FAQ:
http://tiswww.case.edu/php/chet/bash/FAQ

Either set LC_ALL=C in your environment (technically, LC_COLLATE=C is sufficient, but then you have to guarantee that LC_CTYPE is compatible), or use [[:upper:]] and [[:lower:]] instead of [A-Z] and [a-z] for proper locale case-sensitive regexes in your current locale.

Eric Blake <ericb>
Group administrator
Fri 02 Jul 2010 04:01:40 PM UTC, original submission:  

In the following list of files:

test.Jpeg
test.MPEG
test.JPEG
test.Mpeg
test.mpg
test.MPG
test.jpg
test.JPG

I want to find any files with an extension containing uppercases (the point is to then rename them to lowercase).

This works :
find . -regex '.*\.[ABCDEFGHIJKLMNOPQRSTUVWZYZ][a-Z]+$'
find . -regex '.*\.[JM][a-Z]+$'

This returns all of the files, including those who do not have upper cases in them :
find . -regex '.*\.[A-Z][a-Z]+$'

Therefore I believe [A-Z] and [a-z] do not work as they are supposed to.

Anonymous

 

(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

 

Carbon-Copy List
  • -email is unavailable- added by jay (Updated the item)
  • -email is unavailable- added by ericb (Posted a comment)
  • -email is unavailable- added by None (Submitted the item)
  •  

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

    Date Changed by Updated Field Previous Value => Replaced by
    2010-08-15 jay Open/ClosedOpen Closed
    2010-07-02 ericb StatusNone Invalid
        Assigned toNone ericb

    Back to the top

    Powered by Savane 3.14-3b9d.
    Corresponding source code