scsh-users
[Top] [All Lists]

Re: Usage of Shivers' SRE regular expression notation

To: scsh-news@zurich.ai.mit.edu
Subject: Re: Usage of Shivers' SRE regular expression notation
From: "Anton van Straaten" <anton@appsolutions.com>
Date: Tue, 18 Feb 2003 06:13:38 GMT
Organization: EarthLink Inc. -- http://www.EarthLink.net
I wrote:
> (rx (w/nocase (: (or "href" "file") (* whitespace) "=" (* whitespace)
> "\"" (submatch (* (~ ("?\"")))) "\"")))

In case it isn't clear, this simply defines an SRE, it doesn't actually do
anything with it.  Same for the longer version I gave.

The code that did something with the above expression looked more like this:

(define pattern (rx (w/nocase (: (or "href" "file")
  (* whitespace) "=" (* whitespace)
  "\"" (submatch (* (~ ("?\"")))) "\""))))

(regexp-for-each
  pattern
  (lambda (m)
    (let-match m (m s url)
      -- do stuff with matched url
    ))
  str)





<Prev in Thread] Current Thread [Next in Thread>