New procedure RE-MATCH-EXTRACT-STRING.
authorChris Hanson <org/chris-hanson/cph>
Mon, 5 Feb 2001 18:14:54 +0000 (18:14 +0000)
committerChris Hanson <org/chris-hanson/cph>
Mon, 5 Feb 2001 18:14:54 +0000 (18:14 +0000)
v7/src/edwin/edwin.pkg
v7/src/edwin/regexp.scm

index dd0da0700cd3f88555b15252b64760de7275ee10..44ac7efd3e425890da5afe2ce10af2910e4e55ec 100644 (file)
@@ -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
index 65af6eb6fa86b6c3427608563f0b150ca4fd22e0..861430b3c0cfb82179a45f7fb2213a326ebcb1c3 100644 (file)
@@ -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
 ;;;
     (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)