[tbnl-devel] Accessing match information for regex dispatchers?

Stefan Scholl stesch at no-spoon.de
Wed Mar 2 01:57:39 UTC 2005


Hi!

On 2005-03-01 23:32:23, Edi Weitz wrote:
> On Tue, 1 Mar 2005 19:11:13 +0100, Stefan Scholl <stesch at no-spoon.de> wrote:
> > Would it be bad style or a bad idea to extend
> > CREATE-REGEX-DISPATCHER (html.lisp) to hold the result of
> > CL-PPCRE:SCAN in variables you then DECLARE as SPECIAL so that the
> > called handler function can access the match information?
> >
> > Something like *MATCH-START*, *MATCH-END*, *REG-STARTS*, and
> > *REG-ENDS* just visible for the handler.
> 
> I'm not sure if it's bad style but I wouldn't like it.  Why would you
> need it?  The handler has access to the URL anyway.

It was the first time I used CREATE-REGEX-DISPATCHER and I had to
parse the URL in the handler with the same regex. It was just an
idea.

But I like CL-PPCRE:SCAN-TO-STRINGS more and it's clearer this
way, without the specials.


I've done some projects which used mod_rewrite. Typical rewrite
rules matched and parsed a URL giving the registers as parameters
to the "real" address. Maybe that's the reason for my first
impression using CREATE-REGEX-DISPATCHER.


Regards,
Stefan




More information about the Tbnl-devel mailing list