Re: sed bug report
Paolo Bonzini <[email protected]>
| Newsgroups | gmane.comp.gnu.utils.bugs |
|---|---|
| Message-ID | <[email protected]> |
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.