Returns the substring matched by the capture group with the given name or index, or the empty string if the capture group was not matched
(matchresult->captured-substr! index x) → substr
Function:
(defun matchresult->captured-substr! (index x) (declare (xargs :guard (matchresult-p x))) (declare (xargs :guard (matchresult-in-bounds x))) (let ((__function__ 'matchresult->captured-substr!)) (declare (ignorable __function__)) (b* (((matchresult x))) (or (maybe-backref-extract-substr (cdr (assoc-equal index x.backrefs)) x.str) ""))))
Theorem:
(defthm stringp-of-matchresult->captured-substr! (b* ((substr (matchresult->captured-substr! index x))) (stringp substr)) :rule-classes :type-prescription)
Theorem:
(defthm matchresult->captured-substr!-of-matchresult-fix-x (equal (matchresult->captured-substr! index (matchresult-fix x)) (matchresult->captured-substr! index x)))
Theorem:
(defthm matchresult->captured-substr!-matchresult-equiv-congruence-on-x (implies (matchresult-equiv x x-equiv) (equal (matchresult->captured-substr! index x) (matchresult->captured-substr! index x-equiv))) :rule-classes :congruence)