diff options
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/regexp-opt.el | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/regexp-opt.el b/lisp/emacs-lisp/regexp-opt.el index 8c77e9ea5cb..a7ff7b54a58 100644 --- a/lisp/emacs-lisp/regexp-opt.el +++ b/lisp/emacs-lisp/regexp-opt.el @@ -112,7 +112,8 @@ in REGEXP." (string-match regexp "") ;; Count the number of open parentheses in REGEXP. (let ((count 0) start) - (while (string-match "\\\\\\(\\\\\\\\\\)*([^?]" regexp start) + (while (string-match "\\(\\`\\|[^\\]\\)\\\\\\(\\\\\\\\\\)*([^?]" + regexp start) (setq count (1+ count) start (match-end 0))) count))) |