From 92821d933775d2b6af87a6372b53b3596bc105b7 Mon Sep 17 00:00:00 2001 From: jottbee Date: Sat, 26 Feb 2005 08:48:02 +0000 Subject: [PATCH] fixed rx: submatches now contain bos/eos --- common-rules.scm | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/common-rules.scm b/common-rules.scm index f554f1b..69e3c68 100644 --- a/common-rules.scm +++ b/common-rules.scm @@ -100,12 +100,12 @@ (middle (list-ref submatches 1)) (right (list-ref submatches 2)) (constructed-rx (if (and (string? middle) (string=? "%" middle)) - (rx (: (submatch ,left) + (rx (: (submatch (: bos ,left)) (submatch (* any)) - (submatch ,right))) - (rx (: (submatch ,left) + (submatch (: ,right eos)))) + (rx (: (submatch (: bos ,left)) (submatch ,middle) - (submatch ,right))))) + (submatch (: ,right eos)))))) (maybe-match (regexp-search constructed-rx target-name))) (if maybe-match (map (lambda (match-no) @@ -120,9 +120,9 @@ (define (get-submatches-percent target-descr) (map (lambda (match-no) - (match:substring (regexp-search (rx (: (submatch (* any)) + (match:substring (regexp-search (rx (: (submatch (: bos (* any))) (submatch "%") - (submatch (* any)))) + (submatch (: (* any) eos)))) target-descr) match-no)) (list 1 2 3)))