Reputation: 527
I have extendedglob
enabled in zsh
, but extended globbing does not seem to work:
$ print -l /etc/*.@(cfg|conf)
zsh: no matches found: /etc/*.@(cfg|conf)
$ print -l /etc/*.(conf)
zsh: number expected
how can I use regular expressions to list files in /etc which end either in .conf
or in .cfg
?
Upvotes: 0
Views: 667
Reputation: 22225
Wrong syntax. The @(...)
construct is not related to EXTENDED GLOB, but to KSH_GLOB.
setopt extendedglob
print -l /etc/*.(cfg|conf)
As a side note, you can even then not use regular expressions to generate file lists. Regular expressions can only be used to match strings.
Upvotes: 2