summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/regexp-opt.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2000-05-10 22:43:28 +0000
committerStefan Monnier <monnier@iro.umontreal.ca>2000-05-10 22:43:28 +0000
commitac5cb26d90238cc01056928a99f086cfb188dae5 (patch)
tree2f560d78ee2d4387dd4386fe88fc12ca82eddb5a /lisp/emacs-lisp/regexp-opt.el
parent8947a5e23255b77ff0dae73675d3a2e77122c066 (diff)
downloademacs-ac5cb26d90238cc01056928a99f086cfb188dae5.tar.gz
(regexp-opt-depth): Fix regexp.
Diffstat (limited to 'lisp/emacs-lisp/regexp-opt.el')
-rw-r--r--lisp/emacs-lisp/regexp-opt.el3
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)))