[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#10030: grep: strange behavior with '-' in character class
From: |
Erik Auerswald |
Subject: |
bug#10030: grep: strange behavior with '-' in character class |
Date: |
Sun, 13 Nov 2011 13:30:02 +0100 |
User-agent: |
Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20111010 Icedove/3.1.15 |
Hi,
On 11/12/2011 08:05 PM, Thomas Dignan wrote:
echo "/lib64/ld-linux-x86-64.so.2" | grep -o '[a-zA-Z\/0-9\-\.]*'
You probably want to use something like
echo "/lib64/ld-linux-x86-64.so.2" | grep -o '[-a-zA-Z/0-9.]*'
Note: The '-' should be the first character inside a character class if
it is not used to describe a range.
Erik