From: Chris Hanson Date: Thu, 16 Dec 1999 22:06:35 +0000 (+0000) Subject: Implement RE-MATCH-EXTRACT. X-Git-Tag: 20090517-FFI~4407 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=98e72895d05e6a33bd9d7d3bdeccddd8bc71ac83;p=mit-scheme.git Implement RE-MATCH-EXTRACT. --- diff --git a/v7/src/runtime/regexp.scm b/v7/src/runtime/regexp.scm index 6abb536d6..d0a5e522a 100644 --- a/v7/src/runtime/regexp.scm +++ b/v7/src/runtime/regexp.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: regexp.scm,v 1.4 1999/08/20 20:34:12 cph Exp $ +;;; $Id: regexp.scm,v 1.5 1999/12/16 22:06:31 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology ;;; @@ -83,6 +83,11 @@ (if (null? (cdr alternatives)) (list "\\)") (cons "\\|" (loop (cdr alternatives))))))))))) + +(define (re-match-extrace string i regs) + (substring string + (re-match-start-index i regs) + (re-match-end-index i regs))) (define (make-substring-operation name primitive) (lambda (regexp string start end #!optional case-fold? syntax-table) diff --git a/v7/src/runtime/runtime.pkg b/v7/src/runtime/runtime.pkg index cff452e01..4df0d143b 100644 --- a/v7/src/runtime/runtime.pkg +++ b/v7/src/runtime/runtime.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: runtime.pkg,v 14.332 1999/10/23 03:01:46 cph Exp $ +$Id: runtime.pkg,v 14.333 1999/12/16 22:06:35 cph Exp $ Copyright (c) 1988-1999 Massachusetts Institute of Technology @@ -3508,6 +3508,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. guarantee-re-registers preserving-re-registers re-match-end-index + re-match-extract re-match-start-index re-registers re-registers?