Updating regexp-match-num-matches to SRFI 115 regexp-match-count.

This commit is contained in:
Alex Shinn 2014-06-03 21:49:11 +09:00
parent 26716b1a2b
commit c3b265f990
2 changed files with 3 additions and 3 deletions

View file

@ -99,8 +99,8 @@
(%make-regexp-match (make-vector len #f) rx str))
(define (make-regexp-match-for-rx rx str)
(make-regexp-match (rx-num-save-indexes rx) rx str))
(define (regexp-match-num-matches md)
(vector-length (regexp-match-matches md)))
(define (regexp-match-count md)
(- (quotient (vector-length (regexp-match-matches md)) 2) 1))
(define (regexp-match-name-offset md name)
(let lp ((ls (regexp-match-names md)) (first #f))

View file

@ -4,7 +4,7 @@
regexp-matches regexp-matches? regexp-search
regexp-replace regexp-replace-all
regexp-fold regexp-extract regexp-split
regexp-match? regexp-match-num-matches
regexp-match? regexp-match-count
regexp-match-submatch regexp-match-submatch/list
regexp-match->list regexp-match->sexp)
(import (srfi 33) (srfi 69))