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

Pattern matching



>
> Just discovered this.  It will have to wait to be fixed --- it's been
> around for years and no-one's complained.  I'm planning a rewrite of the
> pattern matching code anyway.
>

Just using the occasion. I once suggested to replace ad hoc code with conversion
to standard regexps. I believe, now a days all systems have standard POSIX
regexps available. This will be much more clean and I hope faster. Zsh patterns
are pretty close to normal regular experssions so it should be not a problem
(even SAMBA takes this course for wildcard matching :-) Just some points:

 - currently code scans pattern for every match. This may really be inefficient
for globbing (even more so, as code has to dequote string every time). Using
rgexps pattern can be compiled once - for recursive globbing quite a gain.

 - this may automatically solve the original problem of this post. Regexps are
required to match the longest string, even if every subregexp is not the longest
one.

regards

/andrej





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