Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: libzglob?
- X-seq: zsh-workers 3467
- From: <hzoli@xxxxxxxxxxxx> (Zoltan T. Hidvegi)
- To: zefram@xxxxxxxxx (Andrew Main)
- Subject: Re: libzglob?
- Date: Tue, 26 Aug 1997 14:24:15 -0400 (EDT)
- Cc: hzoli@xxxxxxxxxxxx, zsh-workers@xxxxxxxxxxxxxxx
- In-reply-to: <199708261526.QAA27029@xxxxxxxxxxxxxxxx> from Andrew Main at "Aug 26, 97 04:26:29 pm"
Andrew Main wrote:
> Zoltan T. Hidvegi wrote:
> >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.
>
> That's not what I meant. We're talking about doing globbing. A normal
> regexp engine answers questions of the form "does this string match this
> pattern?", but for globbing we need an engine that can answer "what are
> all the filenames that match this pattern?". libzglob would really have
> to contain its own globbing engine -- Perl currently doesn't have one,
> though it has a good regexp engine.
But glob.c really has three main functions: pattern compiler to struct
comp, pattern matcher (domatch()) and scanner. The scanner scans the
filesystem, and calls domatch() to see if a filename matches a pattern.
This is a bit simplified description, but not completely far from reality.
domatch() can be replaced by a regexp engine.
Zoltan
Messages sorted by:
Reverse Date,
Date,
Thread,
Author