summaryrefslogtreecommitdiff
path: root/re.scm
diff options
context:
space:
mode:
authorBen Sima <ben@bsima.me>2020-05-09 22:31:30 -0700
committerBen Sima <ben@bsima.me>2020-05-09 22:31:30 -0700
commitd4db97edda778fbf77cedc89f62184f412f18edf (patch)
treed67196c22139e9aa63a612b52b1a93b565e9c502 /re.scm
parentfd721e94532ba7f912d13706b3c03056345952e6 (diff)
Add get-tags function
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)))