On this page:
pregexp-match
pregexp-match-positions
pregexp-split
pregexp-replace
pregexp-replace*

 (require mzlib/pregexp) package: compatibility-lib

NOTE: This library is deprecated; use racket/base, instead.

The mzlib/pregexp library provides wrappers around regexp-match, etc. that coerce string and byte-string arguments to pregexp matchers instead of regexp matchers.

The library also re-exports: pregexp, and it re-exports regexp-quote as pregexp-quote.

procedure

(pregexp-match pattern 
  input 
  [start-pos 
  end-pos 
  output-port]) 
  
(or/c (listof (or/c (cons (or/c string? bytes?)
                          (or/c string? bytes?))
                    false/c))
      false/c)
  pattern : (or/c string? bytes? regexp? byte-regexp?)
  input : (or/c string? bytes? input-port?)
  start-pos : exact-nonnegative-integer? = 0
  end-pos : (or/c exact-nonnegative-integer? false/c) = #f
  output-port : (or/c output-port? false/c) = #f

procedure

(pregexp-match-positions pattern 
  input 
  [start-pos 
  end-pos 
  output-port]) 
  
(or/c (listof (or/c (cons exact-nonnegative-integer?
                          exact-nonnegative-integer?)
                    false/c))
      false/c)
  pattern : (or/c string? bytes? regexp? byte-regexp?)
  input : (or/c string? bytes? input-port?)
  start-pos : exact-nonnegative-integer? = 0
  end-pos : (or/c exact-nonnegative-integer? false/c) = #f
  output-port : (or/c output-port? false/c) = #f

procedure

(pregexp-split pattern    
  input    
  [start-pos    
  end-pos])  (listof (or/c string? bytes?))
  pattern : (or/c string? bytes? regexp? byte-regexp?)
  input : (or/c string? bytes? input-port?)
  start-pos : exact-nonnegative-integer? = 0
  end-pos : (or/c exact-nonnegative-integer? false/c) = #f

procedure

(pregexp-replace pattern input insert)  (or/c string? bytes?)

  pattern : (or/c string? bytes? regexp? byte-regexp?)
  input : (or/c string? bytes?)
  insert : 
(or/c string? bytes?
      (string? . -> . string?)
      (bytes? . -> . bytes?))

procedure

(pregexp-replace* pattern input insert)  (or/c string? bytes?)

  pattern : (or/c string? bytes? regexp? byte-regexp?)
  input : (or/c string? bytes?)
  insert : 
(or/c string? bytes?
      (string? . -> . string?)
      (bytes? . -> . bytes?))
Like regexp-match, etc., but a string pattern argument is compiled via pregexp, and a byte string pattern argument is compiled via byte-pregexp.