Bug 447537 - grep -P matches across multiple lines
grep -P matches across multiple lines
Status: CLOSED DEFERRED
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: grep (Show other bugs)
5.3
All Linux
low Severity low
: rc
: ---
Assigned To: Stepan Kasal
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-05-20 09:31 EDT by Petr Šplíchal
Modified: 2016-05-31 21:36 EDT (History)
1 user (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2008-07-18 12:01:54 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Petr Šplíchal 2008-05-20 09:31:22 EDT
When interpreting supplied pattern as perl regular expression grep displays
match across multiple lines --- in spite of the ^beginning-of-line character
specified in the pattern.

Actual result:
$ echo -e "\n\n\n   foo" | grep -P '^\s*foo'



   foo

Expected result:
The leading empty lines should be omitted from the output:

$ echo -e "\n\n\n   foo" | grep -P '^\s*foo'
   foo
Comment 1 Stepan Kasal 2008-07-18 12:01:54 EDT
Unfortunately, the -P option of GNU grep is still only an experimental feature
in the upstream source.

Note You need to log in before you can comment on or make changes to this bug.