Bug 1127559 - grep-2.18 does not match a character with /.?/
Summary: grep-2.18 does not match a character with /.?/
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: grep
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Jaroslav Škarvada
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2014-08-07 07:08 UTC by Petr Pisar
Modified: 2014-08-07 08:50 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2014-08-07 08:50:52 UTC


Attachments (Terms of Use)

Description Petr Pisar 2014-08-07 07:08:45 UTC
With grep-2.18-1.fc20.x86_64:

$ echo 'a b' |grep --color=never -e 'a.b'
a b
$ echo 'a b' |grep --color=never -e 'a.?b'
$ echo 'a b' |grep --color=never -P -e 'a.?b'
a b

grep fails to match a character with /.?/. It happens with cs_CZ.UTF-8 as well as with C locale.

Comment 1 Jaroslav Škarvada 2014-08-07 08:50:52 UTC
From the man:
> In  basic  regular expressions the meta-characters ?, +, {, |, (, and )
> lose their special meaning; instead use the  backslashed  versions  \?,
> \+, \{, \|, \(, and \).

$ echo 'a b' |grep --color=never -e 'a.\?b'
a b

$ echo 'a b' |egrep --color=never -e 'a.?b'
a b


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