From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3063 invoked from network); 30 Jul 1999 09:28:07 -0000 Received: from sunsite.auc.dk (130.225.51.30) by ns1.primenet.com.au with SMTP; 30 Jul 1999 09:28:07 -0000 Received: (qmail 13704 invoked by alias); 30 Jul 1999 09:27:58 -0000 Mailing-List: contact zsh-workers-help@sunsite.auc.dk; run by ezmlm Precedence: bulk X-No-Archive: yes X-Seq: 7322 Received: (qmail 13697 invoked from network); 30 Jul 1999 09:27:58 -0000 X-Envelope-Sender-Is: Andrej.Borsenkow@mow.siemens.ru (at relayer thoth.mch.sni.de) From: "Andrej Borsenkow" To: "Peter Stephenson" , "Zsh hackers list" Subject: Pattern matching Date: Fri, 30 Jul 1999 13:27:51 +0400 Message-ID: <000901beda6d$cb8034e0$21c9ca95@mow.siemens.ru> MIME-Version: 1.0 Content-Type: text/plain; charset="koi8-r" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <9907281225.AA34297@ibmth.df.unipi.it> X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Importance: Normal > > 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