From 022bc59eda200a0570bedba1b41b4d30971c3517 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 5 Feb 2001 18:14:54 +0000 Subject: [PATCH] New procedure RE-MATCH-EXTRACT-STRING. --- v7/src/edwin/edwin.pkg | 3 ++- v7/src/edwin/regexp.scm | 8 +++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/v7/src/edwin/edwin.pkg b/v7/src/edwin/edwin.pkg index dd0da0700..44ac7efd3 100644 --- a/v7/src/edwin/edwin.pkg +++ b/v7/src/edwin/edwin.pkg @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: edwin.pkg,v 1.266 2001/02/05 17:45:42 cph Exp $ +$Id: edwin.pkg,v 1.267 2001/02/05 18:14:54 cph Exp $ Copyright (c) 1989-2000 Massachusetts Institute of Technology @@ -529,6 +529,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. re-match-buffer-forward re-match-data re-match-end + re-match-extract-string re-match-forward re-match-start re-search-backward diff --git a/v7/src/edwin/regexp.scm b/v7/src/edwin/regexp.scm index 65af6eb6f..861430b3c 100644 --- a/v7/src/edwin/regexp.scm +++ b/v7/src/edwin/regexp.scm @@ -1,6 +1,6 @@ ;;; -*-Scheme-*- ;;; -;;; $Id: regexp.scm,v 1.73 1999/06/26 02:02:50 cph Exp $ +;;; $Id: regexp.scm,v 1.74 2001/02/05 18:14:48 cph Exp $ ;;; ;;; Copyright (c) 1986, 1989-1999 Massachusetts Institute of Technology ;;; @@ -35,6 +35,12 @@ (and index (make-mark (re-match-group) index)))) +(define (re-match-extract-string i) + (group-extract-string (re-match-group) + (or (re-match-start-index i) + (error "No such register:" i)) + (re-match-end-index i))) + (define (re-match-group) (let ((group (object-unhash match-group))) (if (not group) -- 2.25.1