# HG changeset patch # User Stefan Monnier # Date 957998488 0 # Node ID 71337b429a49b717ea7c3033d19e082e4ab30418 # Parent 6430ce03c28a3b1e0af95ea2c64ff1592610486c (regexp-opt-depth): Fix regexp. diff -r 6430ce03c28a -r 71337b429a49 lisp/emacs-lisp/regexp-opt.el --- a/lisp/emacs-lisp/regexp-opt.el Wed May 10 22:40:17 2000 +0000 +++ b/lisp/emacs-lisp/regexp-opt.el Wed May 10 22:41:28 2000 +0000 @@ -112,7 +112,8 @@ (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)))