Not sure what I'm doing wrong, but I'm trying to do some project-find-regexp with an expression like this: func() and it still finds everything with func. I was expecting that it only finds "func()", what did I get wrong?
@louis I don't know this specific context but I've worked with regexp libraries that took () as literal and () as grouping operators (e.g. in sed and nvi).
> "I've worked with regexp libraries that took () as literal and () as grouping operators (e.g. in sed and nvi)"
@RogerBW@louis this is the correct answer in the case of Emacs. Here "(...)" are grouping operators, do not use backslashes if you want to match literal paren characters. Another good way to ensure you mean literal parens is to write "[(][)]", i.e. place them in character sets.
Confusingly, Emacs treats "+" as "match one or more" and "+" a literal character, which is the opposite of how Sed and "grep -e" does it. Apart from that, the escape codes in Emacs work pretty much the same as Sed or "grep -e".
Add comment