buggrep - Bugs: bug #20961, hyphen problem: '^[0-9\-_\.]\+$'...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #20961: hyphen problem: '^[0-9\-_\.]\+$' doesnot work while '^[0-9_\.-]\+$' does

Submitted by:  None
Submitted on:  Mon 03 Sep 2007 03:57:57 AM UTC  
 
Category: NoneSeverity: 3 - Normal
Item Group: NoneStatus: Invalid
Privacy: PublicAssigned to: None
Open/Closed: Closed

Mon 03 Sep 2007 09:08:21 AM UTC, comment #1:

[0-9\-_\.] matches any of the characters '.0123456789\]^_', and [0-9_\.-] matches any of '-.0123456789\_'. See the section about the syntax of bracket expressions in the grep manual.

Andreas Schwab <schwab>
Mon 03 Sep 2007 03:57:57 AM UTC, original submission:

$ cat > test.txt
1234-456
1345_456
23445.456
$ grep '^[0-9\-_\.]\+$' < test.txt
1345_456
23445.456
$ grep '^[0-9_\.-]\+$' < test.txt
1234-456 #this line is missing in previous run
1345_456
23445.456

Anonymous

 

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 bonzini (Updated the item)
  • -unavailable- added by schwab (Posted a comment)
  •  

    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 Dec 2009 10:13:35 AM UTCbonziniStatusNone=>Invalid
      Open/ClosedOpen=>Closed
      Summaryhyphen problem: \'^[0-9\\-_\\.]\\+$\' doesnot work while \'^[0-9_\\.-]\\+$\' does=>hyphen problem: '^[0-9\-_\.]\+$' doesnot work while '^[0-9_\.-]\+$' does

    Back to the top


    Powered by Savane 3.1-cleanup1