Or operator in emacs regexp with "Mx occurs"

I wanted to get an overview of my Python program, so I ran:

M-x occur

and for the regex i provided

(def)|(class)

which couldn't match anything.

I also looked at this post and tried

(def)\\|(class)

but that didn't match anything either ...

How do I get M-x occur

for a match class

or def

?

+3


source to share


1 answer


You must use a single backslash (no parentheses, or you must also avoid parentheses):



def\|class

      

+6


source







All Articles