bug-grep
[Top][All Lists]
Advanced

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

How to use \Q \E in GREP in a case-insensitive way?


From: Stormy
Subject: How to use \Q \E in GREP in a case-insensitive way?
Date: Wed, 25 Aug 2010 08:02:08 -0700 (PDT)

however, when I try to make grep match in a case-insensitive way, using -i flag
there are no matches, here's an example:

sh-3.2# echo "TeST" | grep -P test   ==> No match, expected
sh-3.2# echo "TeST" | grep -iP test  ==> Match, expected
TeST
sh-3.2# echo "TeST" | grep -P '\Qtest\E'   ==> No match, expected

sh-3.2# echo "TeST" | grep -P '\QTeST\E'   ==> Match, expected
TeST
sh-3.2# echo "TeST" | grep -iP '\Qtest\E'  ==> No match, UNEXPECTED

I would expect the last example to match, since the -i flag was passed.  I 
rather stay with grep than to switch to perl or parsing the large files 
manually.

Thanks.



reply via email to

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