Add some new procedures for using regular expressions on strings.
authorChris Hanson <org/chris-hanson/cph>
Wed, 24 Apr 1996 01:20:29 +0000 (01:20 +0000)
committerChris Hanson <org/chris-hanson/cph>
Wed, 24 Apr 1996 01:20:29 +0000 (01:20 +0000)
v7/src/edwin/edwin.pkg
v7/src/edwin/regexp.scm

index 1dab8a62256047acf79d7b83cf991e0c4dbb0701..61c7853a06bf90a1d5ad1e5c8b954ad20c276efe 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: edwin.pkg,v 1.187 1996/04/23 23:23:56 cph Exp $
+$Id: edwin.pkg,v 1.188 1996/04/24 01:20:29 cph Exp $
 
 Copyright (c) 1989-96 Massachusetts Institute of Technology
 
@@ -550,6 +550,10 @@ MIT in each case. |#
          re-search-string-forward
          re-search-substring-backward
          re-search-substring-forward
+         re-string-match
+         re-string-search
+         re-substring-match
+         re-substring-search
          re-substitute-registers
          replace-match
          search-backward
index 0c894b412667b099755530268c9007a13ddf1cec..84e6615f6af75b5598110a2ffd786ad2d87f2fb0 100644 (file)
@@ -1,8 +1,8 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Id: regexp.scm,v 1.66 1995/02/02 21:20:02 cph Exp $
+;;;    $Id: regexp.scm,v 1.67 1996/04/24 01:20:21 cph Exp $
 ;;;
-;;;    Copyright (c) 1986, 1989-95 Massachusetts Institute of Technology
+;;;    Copyright (c) 1986, 1989-96 Massachusetts Institute of Technology
 ;;;
 ;;;    This material was developed by the Scheme project at the
 ;;;    Massachusetts Institute of Technology, Department of
                   (mark-index end))))
       (and index
           (make-mark group index)))))
-
+\f
 (define (re-match-forward regexp start #!optional end case-fold-search)
   (let ((end (default-end-mark start end))
        (case-fold-search (default-case-fold-search case-fold-search start))
                                    (mark-index start)
                                    (mark-index end))))
       (and index
-          (make-mark group index)))))
\ No newline at end of file
+          (make-mark group index)))))
+
+(define (re-string-match regexp string #!optional case-fold syntax-table)
+  (let ((case-fold (if (default-object? case-fold) #f case-fold))
+       (syntax-table (if (default-object? syntax-table) #f syntax-table)))
+    (re-match-string-forward (re-compile-pattern regexp case-fold)
+                            case-fold
+                            syntax-table
+                            string)))
+
+(define (re-substring-match regexp string start end
+                           #!optional case-fold syntax-table)
+  (let ((case-fold (if (default-object? case-fold) #f case-fold))
+       (syntax-table (if (default-object? syntax-table) #f syntax-table)))
+    (re-match-substring-forward (re-compile-pattern regexp case-fold)
+                               case-fold
+                               syntax-table
+                               string start end)))
+
+(define (re-string-search regexp string #!optional case-fold syntax-table)
+  (let ((case-fold (if (default-object? case-fold) #f case-fold))
+       (syntax-table (if (default-object? syntax-table) #f syntax-table)))
+    (re-search-string-forward (re-compile-pattern regexp case-fold)
+                             case-fold
+                             syntax-table
+                             string)))
+
+(define (re-substring-search regexp string start end
+                           #!optional case-fold syntax-table)
+  (let ((case-fold (if (default-object? case-fold) #f case-fold))
+       (syntax-table (if (default-object? syntax-table) #f syntax-table)))
+    (re-search-substring-forward (re-compile-pattern regexp case-fold)
+                                case-fold
+                                syntax-table
+                                string start end)))
\ No newline at end of file