zsh-workers
 help / color / mirror / code / Atom feed
* feature request: (pat1&pat2) glob and @(pat1&pat2) kshglob
@ 2017-10-14  9:02 Stephane Chazelas
  0 siblings, 0 replies; only message in thread
From: Stephane Chazelas @ 2017-10-14  9:02 UTC (permalink / raw)
  To: Zsh hackers list

Hi,

ksh93 has a @(pat1&pat2) glob operator. Useful (though not
often I have to admit) for things like: @(????&*a*) for 4-char
file names that contain a "a".

It can currently be emulated with extendedglob:

????~^*a* or ^(^????|^*a*) (or !(!(????)|!(*a*)) kshglob
equivalent) but those are less obvious and require extendedglob.

Since (pat1&pat2) is currently a syntax error and & is not a
glob qualifier, it would be safe to add it even outside
extendedglob like for (pat1|pat2).

Like for (pat1|pat2), we'd want to have *(foo&bar) not be
treated as a glob qualifier.

Adding a @(pat1&pat2) kshglob would improve compatibility with
ksh93 in ksh emulation.

-- 
Stephane


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-10-14  9:02 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-14  9:02 feature request: (pat1&pat2) glob and @(pat1&pat2) kshglob Stephane Chazelas

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).