1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-10 00:00:39 -08:00

(regexp-opt-depth): Fix regexp.

This commit is contained in:
Stefan Monnier 2000-05-10 22:43:28 +00:00
parent 8947a5e232
commit ac5cb26d90
2 changed files with 41 additions and 1 deletions

View file

@ -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)))