On Dec 20, 4:02 am, [EMAIL PROTECTED] wrote: > I've got a pointer to a position in a line of code that contains > either a digit or a period (decimal point). I've got this comment: > > Numbers are one of these: > integers: > digit+ > 0xhex_digit+ > decimals: > digit+.digit*[E['+'|'-']digit+] > .digit+[E['+'|'-']digit+] > digit+[.digit*]% > .digit+% > > Common metacode: '*' = 0 or more, '+' = 1 or more, [] = optional, | = > or, ... > > Now I need to instantiate the comment. How would an experienced Python > coder proceed?
Use a proper lexer written by somebody who knows what they are doing, as has already been recommended to you. -- http://mail.python.org/mailman/listinfo/python-list