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,953 of 2,753   
   benhanson2@icqmail.com to All   
   Re: compiling case insensitive regular e   
   03 Nov 10 10:49:36   
   
   I found that it is more efficient to make the regex case insensitive   
   than to pre-process your input. If you use equivalence classes then   
   there is no increase in table size. The way to do it is to have a case   
   insensitive flag that you can turn on and off (see the flex syntax for   
   (?i: )  etc.) You donbt need to actually update the text of your regex,   
   you just test for the flag when you process each character set and add   
   in both characters then if necessary. So for example (?i:[abc])   
   resolves to [ABCabc].   
      
   HTH   
      
   Regards,   
      
   Ben Hanson (http://www.benhanson.net/lexertl.html)   
      
   --- 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