Can someone please explain why this Emacs regexp
find_class \(\w+|([^)]+)\) \(\w+|([^)]+)\)
does not match in any of these lines?
let _, scn, _ = find_class (obj :: cs) c in scn
aux (find_class (obj :: cs) scn) (cn :: desc)
let _, scn, ms = find_class c cs in
It seems pretty simple: I’m looking for an invocation of the function where the arguments can appear as single words, or parenthesized arbirary strings. When I plug an equivalent expression (find_class (\w+|\([^)]+\)) (\w+|\([^)]+\))) into Ruby it does what I want, but not here. Am I missing something?
I’m finding Emacs’ regexps really cumbersome for practical use, to the point where I’m reconsidering my choice of editor. If there is a reasonable way to improve this (i.e. more concise syntax, more character classes), I am dying to hear it, but I haven’t found anything yet.
I think you need
\|in emacs regex to achieve same effect as|in Ruby.