bug-grep
[Top][All Lists]
Advanced

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

Grep Bug


From: Pedro Faria
Subject: Grep Bug
Date: Mon, 13 Dec 2010 16:40:51 +0000

Hello,

I was trying to make a regular expression, in mode -P, with grep to take
every comment in a .c source code. The expression that I use was:

cat cSource | grep -o -P '/\*(.|\n|\r)*\*/'

The result of this operation was 'Segmentation fault' (instead of a warning
or so..), I know that i used a greedy expression, the correct one should be
'/\*(.|\n|\r)*?\*/' to take the smallest match (it works!). I don't know if
you consider this a bug or only a user mistake, if it's the latter sorry for
the waste of time :)

Best regards (and sorry for the bad english),

Pedro Faria


reply via email to

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