How can I use occur (M-s o) to search for a string that contains a backslash, e.g. \def?

1 Answer 1


You need to escape the backslash with another backslash. So: M-s o \\def

See the manual node on "Syntax for Strings" for more information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.