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 2,031 of 2,753   
   glen herrmannsfeldt to All   
   Inverse grep   
   08 Jun 11 23:01:57   
   
   From: gah@ugcs.caltech.edu   
      
   I suppose this is a strange question, but I was wondering if   
   there was ever something like an inverse grep.  That is,   
   match a string against a file full of regular expressions.   
      
   Now, one could just read the file, compile the regex one at   
   a time, and do the match, but maybe there is another way.   
      
   -- glen   
   [If you want to know which pattern it was, there's flex which turns all   
   the patterns into one DFA with tags to know which one it was, or else   
   there's the perl "study" operator which pre-scans a string to make its   
   NFA matcher faster on subsequent runs against the same string. -John]   
      
   --- 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