Bruce, The "?" is actually part of the preceding "*", to make the match all non-greedy. Try this regex on some "C" code with comments, if you replace the "*?" with a "*", it will match all of the following, rather than just the first comment.
/* A comment. */ some_code(); /* Another comment. */ Definitely not what is required. TomH On Jul 7, 10:33 am, Bruce Frederiksen <[email protected]> wrote: > I think that the "?" was meant to be the "\". But I suppose it would still > work, just redundant. > > -Bruce > > On Tue, Jul 6, 2010 at 8:22 PM, celephicus <[email protected]> wrote: > > Greetings, > > > I am using the "C" lexer rules copied from the manual page V3.3. The > > rule for comments needs an extra "\" before the third "*" to be a > > legal re. The "pass" might as well go as well. > > > def t_ccode_comment(t): > > r'(/\*(.|\n)*?*/)|(//.*)' -> r'(/\*(.|\n)*?\*/)| > > (//.*)' > > pass > > > -- > > You received this message because you are subscribed to the Google Groups > > "ply-hack" group. > > To post to this group, send email to [email protected]. > > To unsubscribe from this group, send email to > > [email protected]<ply-hack%[email protected]> > > . > > For more options, visit this group at > >http://groups.google.com/group/ply-hack?hl=en. -- You received this message because you are subscribed to the Google Groups "ply-hack" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/ply-hack?hl=en.
