5
(defun re-backward-match-group (rexp &optional n)
"Grab the previous matches of regexp and return the contents of
the n match group (first group match if no n arg is specified)"
(save-excursion
(unless n
(setq n 1))
(when (numberp n)
(when (re-search-backward-lax-whitespace rexp)
(when (= (+ 2 (* n 2)) (length (match-data)))
(match-string-no-properties n))))))
bir hata
re-search-backward-lax-whitespace
tarafından atılır Bunu nasıl hatayı yakalamak ve nil veya ""
dönecekti? Opsiyonel bir noerror
argümanına sahip
Yüksek, bkz size @Barmar teşekkür – ocodo