Hi,

Roy T. Fielding schrieb:
> On Nov 24, 2008, at 5:06 AM, Felix Meschberger wrote:
>> Better yet, we might do regular expression matching and referencing:
>>
>>                  /etc/map/http/www.(.)*.com.80/
>>                     +-- sling:contentPrefix = "/content/sites/$1/
>>
>> Question, though, is how to get these strings into the repository: We
>> would probably need some encoding because interesting regexp characters
>> like [, ], * and | are not valid characters for JCR item names.
> 
> I think we need to be careful how much complexity is added here.
> It will be in the critical path for all request handling.  We could
> use an empty selector to indicate "*" ("any match").  I don't think
> we need anything more complex than that right now.  E.g.,
> 
>     /etc/map/http/.com.80/         (matches *.com on port 80)
>     /etc/map/http/www..com.80/     (matches www.*.com on port 80)
>     /etc/map/http/www...80/        (matches www.*.* on port 80)

Sounds good.

This could even be extended to the scheme field and be generalized:

    /etc/map/http./                  (matches http and https)
    /etc/map/http/.sample.com./      (matches *.sample.com on any port)
    /etc/map/http/.../               (matches * on any port)

More elaborate regular expressions may be specified in the sling:match
property, which I defined in the sling:MatchingSpec mixin node type
(code already exists, so it wouldn't possible hurt to keep it).

Regular expressions bear another problem of course: It is probably not
trivial to implement reverse mapping.

Regards
Felix

Reply via email to