If you have a regular expression as a string, you can use cl-ppcre:parse-stringto convert it to sexp, which you can check for cases :REGISTERlike
(count :register (alexandria:flatten (ppcre:parse-string "^\\d (\\S+|(x|y))")))
If it has already been created using create-scanner, I don’t think you have many options; this object is an opaque closure.
source
share