Searching for literal "> \" using ack-grep

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/\> /


Solution 1:

Wow, I was so close ... single quotes:

$ ack-grep '\> \\'

Figured this out after confirming that my regex match was valid using: http://regexpal.com/ and just happened to have had single quotes from trying something else.

Solution 2:

This also works:

$ ack-grep '> \\'

and so does:

$ ack-grep "> \\\\"

The greater-than doesn't need to be escaped.