Hello!
On Sun, Nov 2, 2014 at 8:33 PM, rvsw wrote:
> If it is known that replace_filter will only have strings i.e. no regex as
> argument,
The replace_filter directive *does* support regex as its first argument:
https://github.com/openresty/replace-filter-nginx-module#replace_filter
Do you mean use of nginx variables in the regex argument here?
> is it possible to use sregex in a way that it does parse / look
> for regex arguments.
I cannot parse this question. Will you rephrase or elaborate?
> As I understand, the assumption that an argument may
> be a regex causes sregex to do additional processing with a performance
> penalty. Is there a way (or at least a direction in which I can proceed to
> modify code), just string processing can be done.
>
Assuming you mean using nginx variables in the regex argument, yes, it
is doable. But we'll need an LRU cache for the compiled regexes
because compiling regexes upon every request is very expensive :)
Regards,
-agentzh