httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: mod_proxy_fcgi issues
Date Sat, 06 Dec 2014 15:11:57 GMT
On Sat, Dec 6, 2014 at 3:29 PM, Eric Covener <covener@gmail.com> wrote:
> You can call single-argument functions that returns a string, and I
> believe that single argument is interpolated by ap_expr so it could be
> powerful.   A function could then have its own delimeter to work
> around the problem with args.  This is only worth discussing to save
> the work/risk in changing the expression parser itself. The function
> would not need to be fcgi specific, it would just be like e.g. PHP's
> preg_replace() or somehow in an operator (that isn't =~)

How about an ap_expr's function to help on this? (like Jan's
replace(), but for regexps)

Something like: extract([subject], [capture(s)], [substitution]):
=> substitute(%{PATH_INFO}, "^(.*)/strippedpathinfo(/.*)/notpathinfo", "$1$2").
so to extract all is captured by [capture(s)] and play with it (them)
in [substitution].

Or: substitute([subject], [pattern], [substitution]):
=> substitute(%{PATH_INFO}, "^(.*)/notpathinfo.*", "$1").
so to substitue all is matched by [pattern] with [substitution].
(hence the trailing .* is needed here).

Just a matter of taste...

Regards,
Yann.

Mime
View raw message