[ic] Apply strip filter globally
Jon Jensen
jon at endpoint.com
Thu Jun 5 20:55:36 UTC 2008
On Thu, 5 Jun 2008, Davor Ocelic wrote:
>> Filter mv_searchspec none
>> Filter * strip
>
> One other thing to discuss here is what would happen if a variable
> would match multiple regexes?
And that's not even a regex -- it's a glob. This brings up the question of
expectations. How do you know a regex is intended, and not a complete
literal? mv_searchspec could be a regex or a literal, but as a regex it
would match mv_searchspecial as well.
Perhaps due to backward compatibility, globs would be easier to add. But
they sure aren't as flexible.
Maybe a perly notation like:
Filter mv_searchspec none
Filter /.*/ strip
Would work.
> Ideally we'd execute all matching filters, but since the data structure
> behind is a hash and loses order of insertion, multiple filters in
> random order could cause more confusion than benefit.
It'd be worth coming up with a way to specify the order, as I think
allowing multiple matches based on different regexes would be one of the
bigger benefits of this.
At the risk of all the disgust you can send me via email, you could do:
Filter mv_searchspec none
Filter z/.*/ strip
Where the leading character is a sort order relative to other filters.
But it's so ugly I almost couldn't type it.
What's really called for here is probably a new configuration directive
type this is an ordered hash, so we can just define them in the order we
want and that's how they're applied. Such a directive type would probably
come in handy for other things later as well.
Jon
More information about the interchange-users
mailing list