home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.compilers      Compiler construction, theory, etc. (Mod      2,753 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 1,340 of 2,753   
   Daniel Villeneuve to Stefan Monnier   
   Re: Leftmost longest match with DFA sear   
   11 May 08 11:42:22   
   
   From: daniel2villeneuve@videotron.ca   
      
   Stefan Monnier wrote:   
   > Can someone point me to articles that discuss various ways to get the   
   > leftmost longest match when implementing regexp search using a DFA?   
   >   
   > The "obvious" solution of turning the problem "search for RE" into the   
   > problem "match .*RE" (where I use "match" here to mean "anchored   
   > search") only gives you the leftmost shortest match.   
   [snip]   
   >         Stefan   
      
   I've used the approach to compile a DFA for the reverse RE, say ER, and   
   first match .*ER on the reverse text to find the leftmost anchor point.   
     Then match RE from that point to find the longest span.   
   --   
   Daniel Villeneuve   
   Kronos   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca