From ac5cb26d90238cc01056928a99f086cfb188dae5 Mon Sep 17 00:00:00 2001 From: Stefan Monnier Date: Wed, 10 May 2000 22:43:28 +0000 Subject: (regexp-opt-depth): Fix regexp. --- lisp/emacs-lisp/regexp-opt.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lisp/emacs-lisp/regexp-opt.el') 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))) -- cgit v1.2.1