summaryrefslogtreecommitdiff
path: root/re.scm
diff options
context:
space:
mode:
Diffstat (limited to 're.scm')
-rw-r--r--re.scm8
1 files changed, 6 insertions, 2 deletions
diff --git a/re.scm b/re.scm
index b4f3dca..f6f4b75 100644
--- a/re.scm
+++ b/re.scm
@@ -1,7 +1,11 @@
#!r6rs
(library (re (0))
- (export match)
+ (export match group)
(import (rnrs base (6))
(ice-9 regex))
(define (match s pat)
- (string-match pat s)))
+ (string-match pat s))
+ (define (group m n)
+ (if m
+ (match:substring m n)
+ #f)))