zsh-workers
 help / color / mirror / code / Atom feed
* RegEx glob mode?
@ 1999-03-19  2:48 E. Larry Lidz
  1999-03-19  8:49 ` Peter Stephenson
  0 siblings, 1 reply; 2+ messages in thread
From: E. Larry Lidz @ 1999-03-19  2:48 UTC (permalink / raw)
  To: zsh-workers


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.

I'm sure it'd confuse a lot of people (why doesn't ls foo* match foobaz?)
but as an option, I think it'd be extremely popular, particularly for
certain shell scripts...

[cc me with discussion? I'm not on the list.]

-Larry


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: RegEx glob mode?
  1999-03-19  2:48 RegEx glob mode? E. Larry Lidz
@ 1999-03-19  8:49 ` Peter Stephenson
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Stephenson @ 1999-03-19  8:49 UTC (permalink / raw)
  To: zsh-workers, E. Larry Lidz

"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@ibmth.df.unipi.it>       Tel: +39 050 844536
WWW:  http://www.ifh.de/~pws/
Dipartimento di Fisica, Via Buonarroti 2, 56127 Pisa, Italy


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~1999-03-19  9:06 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-19  2:48 RegEx glob mode? E. Larry Lidz
1999-03-19  8:49 ` Peter Stephenson

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).