diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index b841dc1d179..28bd42aebde 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -2076,7 +2076,8 @@ directory, used as the root of the ignore globs." (replace-regexp-in-string ;; FIXME: Add tests. Move to subr.el, make a public function. ;; Maybe error on Emacs-only constructs. - "\\(?:\\\\\\\\\\)*\\(?:\\\\[][]\\)?\\(?:\\[.+?\\]\\|\\(\\\\?[(){}|]\\)\\)" + (rx (zero-or-more "\\\\") (opt "\\" (any "[]")) + (or (seq "[" (+? nonl) "]") (group (opt "\\") (any "(){|}")))) (lambda (str) (cond ((not (match-beginning 1))