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

Re: alternation option end of string



On Sat, May 2, 2026 at 6:45 AM Ray Andrews <rayandrews@xxxxxxxxxxx> wrote:
>
>
> On 2026-05-01 17:44, Eric Cook wrote:
> > So, bart guessed correct, you are using pattern matching.
> > string=cats; print -- ${(M)string##cat(s|)}
> I wonder if I have my terminology correct -- I thought Bart was
> suggesting that I was matching filenames -- globbing, yes?  But it was
> me who said that, no, I'm doing pattern matching.  The strings are in
> fact filenames, but in the current situation they're just strings,
> there's no completion of lists of files so I'm not calling that globbing.

globbing and (zsh) string matching are nearly identical, so most
people tend to use either term for both things. The main difference is
that * can match across a / in string matching but not in globbing.
Ie, a*b will match "a/b" but not the file a/b, but pretty much
everything else works the same (where applicable).

-- 
Mikael Magnusson




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