I've been on a bit of a tear with match lately but I find myself re-running the match operation to take advantage of the match. For instance:
define (find-email candidate)
(define rule-name "Email Address")
(define simple-email-regex (pregexp "\\S+@\\S+\\.\\S+"))
(match candidate
[(pregexp simple-email-regex)
(list (regexp-match simple-email-regex candidate)) #t)]
[_ (list null #f)]))
I've simplified the code a little bit but I want to pass back what matched and some metadata (in this case simply a boolean).
I'm looking to tidy up my code and so I wonder if a fellow match user could tell me where match stores the result of the match. So I don't rerun the rexexp match?