Skip to content

Instantly share code, notes, and snippets.

@shirok
Last active December 12, 2015 03:58
Show Gist options
  • Save shirok/4710866 to your computer and use it in GitHub Desktop.
Save shirok/4710866 to your computer and use it in GitHub Desktop.
(define (rxmatch-substrings match)
(if match
(map (cut rxmatch-substring match <>) (iota (rxmatch-num-matches match)))
'()))
(define (rxmatch-indices match)
(if match
(map (^i (cons (rxmatch-start match i) (rxmatch-end match i)))
(iota (rxmatch-num-matches match)))
'()))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment