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

Re: RegEx glob mode?



"E. Larry Lidz" wrote:
> Something that I'd love to see in a shell is a mode to replace normal
> globbing with regex matching. So that things like:
> 
> ls (foo|bar)?baz.*
> 
> would work.

It might be possible to insert an existing regular expression library into
the code (I can't see anyone writing it specially), but actually you can do
most things with the existing code when the `extendedglob' option is set.
In this case, (foo|bar|)baz* will match what you want, or with the
`kshglob' option set, ?(foo|bar)baz* which looks even more like what you
wanted.  Although a good library would probably be a good deal faster than
the existing code for most things.

-- 
Peter Stephenson <pws@xxxxxxxxxxxxxxxxx>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy



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