Test whether a given string matches a given regular expression
(do-regex-match-precomp str regex opts) → (mv whole substrs)
Function:
(defun do-regex-match-precomp (str regex opts) (declare (xargs :guard (and (stringp str) (regex-p regex) (parse-opts-p opts)))) (let ((__function__ 'do-regex-match-precomp)) (declare (ignorable __function__)) (b* ((str (mbe :logic (if (stringp str) str "") :exec str)) (transstr (if (parse-options-case-insensitive opts) (str::downcase-string str) str)) ((mv ?matchp whole substrs) (match-regex regex transstr str))) (mv whole substrs))))
Theorem:
(defthm return-type-of-do-regex-match-precomp.whole (b* (((mv ?whole ?substrs) (do-regex-match-precomp str regex opts))) (or (stringp whole) (not whole))) :rule-classes :type-prescription)
Theorem:
(defthm true-listp-of-do-regex-match-precomp.substrs (b* (((mv ?whole ?substrs) (do-regex-match-precomp str regex opts))) (true-listp substrs)) :rule-classes :type-prescription)
Theorem:
(defthm string-or-nil-listp-of-do-regex-match-precomp-substrs (string-or-nil-listp (mv-nth 1 (do-regex-match-precomp str regex opts))))