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

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

grep bug with -P -o option


From: fd
Subject: grep bug with -P -o option
Date: Wed, 14 Jul 2010 19:43:31 -0700 (PDT)
User-agent: G2/1.0

Dear all

I'm a novice in this Linux business, but I think there's something not
right. When I try to search using a perl regular expression, so if a
do:

gcc --help | grep -P  '(?<=the )'

I get all lines for which there is any text preceded by "the "


  -dumpspecs               Display all of the built in spec strings
  -dumpversion             Display the version of the compiler
  -dumpmachine             Display the compiler's target processor
  -print-search-dirs       Display the directories in the compiler's
search path
  -print-libgcc-file-name  Display the name of the compiler's
companion library
  -print-file-name=<lib>   Display the full path to library <lib>
  -print-prog-name=<prog>  Display the full path to compiler component
<prog>
  -print-multi-directory   Display the root directory for versions of
libgcc
  -print-multi-lib         Display the mapping between command line
options and
...

If I introduce the -o option so that I have only the part of each line
that matches a pattern I have no result

gcc --help | grep -P -o '(?<=the )'

Is this a bug, or am I doing something wrong.

Thanks for any help



reply via email to

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