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,339 of 2,753   
   Stefan Monnier to All   
   Leftmost longest match with DFA search   
   10 May 08 04:36:57   
   
   From: monnier@iro.umontreal.ca   
      
   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.   
      
   I've already seen http://compilers.iecc.com/comparch/article/07-10-026   
   where Tcl's approach to the problem is described, which is sadly O(N^2).   
      
   I'm also interested in similar approaches using non-backtracking NFAs   
   (I'm familiar for example with the algorithm used in Plan9's regexp   
   library).   
      
           Stefan   
      
   --- 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