Searching for literal "> \" using ack-grep

Posted by Stephen Gornick on Server Fault See other posts from Server Fault or by Stephen Gornick
Published on 2010-06-01T01:01:44Z Indexed on 2010/06/01 1:03 UTC
Read the original article Hit count: 601

Filed under:
|
|

I am looking for lines that literally have a greater than character (a ">") followed by a space followed by a backslash character (a "\") i.e., a line with this: > \

I thought escaping would allow this, and for the greater-than it does: $ ack-grep "> " returns lines that have "> " in them.

But when I try to escape the backslash as well I get: $ ack-grep "> \"

ack-grep: Invalid regex '> \': Trailing \ in regex m/> \/

© Server Fault or respective owner

Related posts about grep

Related posts about regex