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,474 of 2,753    |
|    Joel E. Denny to mjmjenks@gmail.com    |
|    Re: Flex and Lex interpreting regex diff    |
|    13 Oct 08 11:36:20    |
   
   From: jdenny@ces.clemson.edu   
      
   On Mon, 13 Oct 2008 mjmjenks@gmail.com wrote:   
   > It looks like I'm having an issue with the portability of one of my   
   > regular expressions.   
      
   > ScaleFactor [ED]([\+\-]?){digit}+   
      
   Rewrite as:   
      
    ScaleFactor ([ED]([\+\-]?){digit}+)   
      
   Flex adds these parentheses for you. Lex does not.   
      
   > ({digit}+)[\.]({digit}+)({ScaleFactor}?) {printf("Real number   
   > token");};   
      
   The difference is whether that "?" after the "{ScaleFactor}" applies to   
   the "{digit}+" at the end of "{ScaleFactor}" or to all of "{ScaleFactor}".   
      
   --- 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