Returns the substring matched by the capture group with the given name or index, or NIL 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))) (maybe-backref-extract-substr (cdr (assoc-equal index x.backrefs)) x.str))))
Theorem:
(defthm maybe-stringp-of-matchresult->captured-substr (b* ((substr (matchresult->captured-substr index x))) (acl2::maybe-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)