bug-gnu-utils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sed bug report


From: Paolo Bonzini
Subject: Re: sed bug report
Date: Wed, 13 Jun 2012 09:55:05 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:13.0) Gecko/20120605 Thunderbird/13.0

Il 13/06/2012 05:04, Josh McFarlane ha scritto:
> I believe I have found a potential bug in sed extended regular
> expressions. Using the following command:
> $sed -n -r '/^\s*[^\s]+\s*$/p' test.txt

[^\s] is not supported by sed.  You need to use \S.

Paolo

> 
> Where test.txt conatins:
> a
>        b
> a b
> 
> Produces the following output:
>  a
>        b
> a b
> 
> In my opinion this is an unexpected behavior as this regular
> expression should only print lines where there is zero or more
> whitespace characters, followed by one or more non whitespace
> characters, followed by zero or more whitespace characters, followed
> by the end of the line.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]