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

Re: libzglob?



Andrew Main wrote:
> Zoltan Hidvegi wrote:
> >The scanner in zsh glob can be used for perl, however the pattern
> >matching part has some problems.  One for example is that (ab#)# does not
> >match ab.
>
> Why?

Because there is no proper backtracking, the glob code sees that `a' alone
matches `ab#' and then it tries to match the rest of the string, `b' with
the rest of the glob pattern (which is nothing).

> >           For perl, a zsh glob -> regexp translator would be much more
> >roboust and relyable.
>
> But then in order to do actual file globbing, a second regexp execution
> engine would be required.  This is not necessarily a bad approach --
> it has the potential to allow globbing based on full Perl regexps --
> but it might be better to stick with zsh's special purpose code.

Yes, for zsh.  But the question was to use the zsh glob within perl, which
already have the regexp engine.  I'd thing that even for zsh the regexp
engine would be superior, but it is quite big, and zsh is big enough even
without regexps.  Of course a loadable regexp module can be added to zsh.

Zoli



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