[plt-scheme] inverse regexp

From: maxigas (maxigas at anargeek.net)
Date: Sat Jan 17 17:28:09 EST 2009


i am writing an application using dispatch (as you suggested earlier) which would process all
URLs, but i want to exclude the htdocs directory to serve static files.  i understand that
serve/servlet's #:servlet-regexp key controls which URLs are passed to start, but i couldn't find
out how to write a regexp which excludes "htdocs".

so what i want is to match everything that is NOT #rx"^/htdocs/.*"

i have something like this in my web server config section:

 #:servlet-path "/"
 #:servlet-regexp #rx".*tag1.*"
 #:launch-browser? #f
 #:port 8080
 #:file-not-found-responder file-not-found
 #:command-line? #f)

Posted on the users mailing list.