cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Donald Ball <ba...@webslingerZ.com>
Subject Re: [Cocoon 2] Regex matchers :-)
Date Fri, 12 May 2000 18:20:55 GMT
On Fri, 12 May 2000, Stefano Mazzocchi wrote:

> Now, how can this work using full regexp? say we allow the use of
> pluggable matching with sort of XPointer syntax
> 
>  <redirect 
>   source="regexp(/htdocs/foo/[a|b|c]/index.html)" 
>   target="/xdocs/*/index"
>  />
> 
> What does the star mean? [a|b|c]? I can't see how this can be easier
> than using wildcards... less verbose, totally, but reducing verbosity
> doesn't always increase readability, expecially in configurations.

you would do this:

<redirect
 source="regexp(/htdocs/foo/([a|b|c])/index.html)"
 target="/xdocs/$1/index"
/>

$1 refers to the first paranthesized match, $2 the second, etc. Have you
never used perl or general UNIX regexps before? The pattern matching and
variable referral rules are well understood.

- donald


Mime
View raw message