[Bug 95936] egrep(1) misparses multiline parenthetical grouping

bugzilla-noreply at freebsd.org bugzilla-noreply at freebsd.org
Thu Apr 20 15:07:20 UTC 2017


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=95936

Kyle Evans <bsdports at kyle-evans.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bsdports at kyle-evans.net

--- Comment #1 from Kyle Evans <bsdports at kyle-evans.net> ---
Hi (delayed response),

This is actually intended behavior. It's not so much that it doesn't correctly
see it, it's that newlines are pattern delimiters, so this is actually broken
into two different patterns: '(', and 'hi)'. To verify, check:

$ printf "hi\nthere" | egrep -o "hi
er"
hi
er
# Correct

This is probably dual purpose:

1. Maintains consistency with file-read patterns (-f)
2. grep is inherently line-oriented, thus making it nonsensical to actually
match on newlines.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list