Severity: wishlist
Just wondering if the following is of any interest:
(defun string-matched-text (regexp string num &optional start)
""
(when (string-match regexp string start)
(match-string num string)))
Then,
(let ((str "foo-123"))
(when (string-match "[[:alpha:]]+-\\([0-9]+\\)" str)
(match-string 1 str)))
=> "123"
is equivalent to:
(string-matched-text "[[:alpha:]]+-\\([0-9]+\\)" "foo-123" 1)
=> "123"
This looks useful, but I think it would be even better to add it as a pcase macro to be composable (see attached patch).