Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] Add zsh/re2 module with conditions



Phil Pennock wrote:
> At this point, I haven't done anything about rebinding =~ to handle
> this.  It's purely new infix-operators based on words.  I'm thinking
> perhaps something along the lines of $zsh_reop_modules=(regex), with
> `setopt rematch_pcre` becoming a compatibility interface that acts as
> though `pcre` were prepended to that list and
>
>   zsh_reop_modules=(pcre regex)
>
> having the same effect.  Then I could use `zsh_reop_modules=(re2 regex)`.
> Does this seem sane?  Anyone have better suggestions?  I do want to have

If the first listed module in the array has control of =~, what is
the meaning of subsequent ones?

How about perhaps using a module alias so you would do, e.g.
  zmodload -A zsh/default/regex=zsh/re2

Oliver



Messages sorted by: Reverse Date, Date, Thread, Author