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

 
 

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

Submitted by:  None
Submitted on:  Fri 02 Jul 2010 04:01:40 PM UTC  
 
Category: findSeverity: 3 - Normal
Item Group: Wrong resultStatus: Invalid
Privacy: PublicAssigned to: Eric Blake <ericb>
Originator Name: Alexandre de VerteuilOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 4.4.2
Fixed Release: None

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

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

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

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

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

    Date Changed By Updated Field Previous Value => Replaced By
    Sun 15 Aug 2010 03:49:15 PM UTCjayOpen/ClosedOpen=>Closed
    Fri 02 Jul 2010 04:18:43 PM UTCericbStatusNone=>Invalid
      Assigned toNone=>ericb

    Back to the top


    Powered by Savane 3.1-cleanup1