1
;; return the substring of STRING matched in MATCH-VECTOR,
2
;; the Nth subexpression match (default 0).
3
(define (re-match-nth string match-vector . n)
4
(let ((n (if (pair? n) (car n) 0)))
5
(substring string (car (vector-ref match-vector n))
6
(cdr (vector-ref match-vector n)))))
8
(define (re-before-nth string match-vector . n)
9
(let ((n (if (pair? n) (car n) 0)))
10
(substring string 0 (car (vector-ref match-vector n)))))
12
(define (re-after-nth string match-vector . n)
13
(let ((n (if (pair? n) (car n) 0)))
14
(substring string (cdr (vector-ref match-vector n))
15
(string-length string))))
b'\\ No newline at end of file'