grep - Bugs: bug #27669, issue using ^ with -z
You are not allowed to post comments on this tracker with your current authentication level.
bug #27669: issue using ^ with -z
Submitter: | Peter Jakobi <jakobi> | ||
Submitted: | Sun 11 Oct 2009 03:12:00 PM UTC | ||
Category: | None | Severity: | 3 - Normal |
Item Group: | None | Status: | In Progress |
Privacy: | Public | Assigned to: | None |
Open/Closed: | Open |
Tue 28 Jun 2011 09:22:49 AM UTC, comment #2: |
Paolo Bonzini <bonzini> |
Sat 06 Mar 2010 09:19:06 AM UTC, comment #1: As a workaround you can use \` instead of ^ |
Paolo Bonzini <bonzini> |
Sun 11 Oct 2009 03:12:00 PM UTC, original submission:
Please verify these cases to work both with the unmodified most recent source:
|
Peter Jakobi <jakobi> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 2 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2011-06-28 | bonzini | Attached File | - | Added p1.patch, #23580 | |
Status | None | In Progress |
Powered by Savane 3.13-f8d8.
Corresponding source code
This looks like it was fixed recently, but only in the case when the DFA matcher is used:
$ perl -e '@a=qw/abc def ghi/; foreach(@a){print "$_\n\0"}' | grep -z ^d[e-g]f
$ perl -e '@a=qw/abc def ghi/; foreach(@a){print "$_\n\0"}' | grep -z ^def
def
For glibc we would probably need a new syntax bit, RE_NULL_NEWLINE.
While doing that, and for the sake of consistency, I'm also tempted to make ^ and $ match newlines in the middle of the NULL-separated record; \` and \' would still be available to match beginning and ending of record. This is a partial patch that implements this in dfa.c.
(file #23580)