s c h e m e w i k i . o r g

/ SearchResult? / Scm.PattMatchCommented

This Web


WebHome 
WebChanges 
WebTopicList 
WebStatistics 

All Webs


Chicken
Cookbook
Erlang
Know
Main
Plugins
Sandbox
Scm
TWiki  

Schematics


Schematics Home
TWiki Shorthand

Offsite Links


Schemers.org
Lambda the Ultimate
twiki.org
(require (lib "pregexp.ss" "mzlib") (lib "dns.ss" "net"))

(define commented-regexp (pregexp "((?x: ; Ignore whitespace (?x: ; Capture the inet address (?! [\\-_] ) ; don't lookahead for underscore/dash [\\w\\-] + ; hostname component \\. ; dot )+ ; repeat a few times [A-Za-z] ; ... followed by a letter [\\w\\-] + ; and trailing domain part ))"))

(define (make-detailed-name name) (let* ((addr (dns-get-address "ns1.granitecanyon.com" name)) (replace (string-append "\\1 [" addr "]"))) (pregexp-replace commented-regexp name replace)))

 
 
© 2004 by the contributing authors. / You are Main.guest