bugGNU nano - Bugs: bug #49671, Regular Expression Behavior...

 
 

bug #49671: Regular Expression Behavior Depends on Case-Sensitive Setting

Submitted by:  Don Swaner <dswaner>
Submitted on:  Wed 23 Nov 2016 02:01:57 AM UTC  
 
Severity: 3 - NormalStatus: Invalid
Assigned to: Benno Schulenberg <bens>Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

Wed 23 Nov 2016 08:03:19 PM UTC, comment #3:

(The "lower" comment field is for when a file is being attached.)

Yes, using [[:upper:]] or [[:lower:]] together with case insensitivity /is/ confusing. And... one might still consider it a bug, or at least a deficiency: regexes would be slightly more powerful if one could combine case insensitivity (in spelled-out characters) with case sensitivity (in character classes). But it is only a small advantage: if one can spell out the characters, one can also (with a little more work) spell out both cases.

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 23 Nov 2016 12:12:46 PM UTC, comment #2:

Sorry but I'm new to Savannah. I thought I posted a comment last night, but apparently it didn't take. (I used the "lower" comment instead of the "upper" comment.) But yes, you are correct - this is NOT A BUG, but a mis-understanding on my part. "grep -i" gives the same results as nano. It is just a little confusing when 'grep -i "[[:lower:]]" ...' selects all letters, upper and lower case.

Don Swaner <dswaner>
Wed 23 Nov 2016 08:39:37 AM UTC, comment #1:

Hello Don,

When in vim I search for [[:upper:]][[:lower:]], it will find any pair of letters, case-insensitively. Only when I first do :set noignorecase (or add \C to the search string) does it find only the upper-lower pairs. Nano behaves the same way. So I don't see how this is wrong. Maybe you could add "set casesensitive" to your .nanorc, so that when you search for [[:lower:]] and/or [[:upper:]], you get what you want?

Benno Schulenberg <bens>
Project AdministratorIn charge of this item.
Wed 23 Nov 2016 02:01:57 AM UTC, original submission:

Regular expression behavior in nano is peculiar to nano when case-insensitive is in effect. For example, a regular expression search for [[:lower:]] finds both upper and lower case letters. If this behavior is intended, or if it not feasible to change this behavior, then the nano documentation references to regular expressions should be expanded to explain the difference between normal regular expressions and nano regular expressions.

Don Swaner <dswaner>

 

(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 bens (Posted a comment)
  • -unavailable- added by dswaner (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
    Wed 23 Nov 2016 08:03:19 PM UTCbensStatusNone=>Invalid
      Open/ClosedOpen=>Closed
    Wed 23 Nov 2016 08:39:37 AM UTCbensAssigned toNone=>bens

    Back to the top


    Powered by Savane 3.1-cleanup1