excluding search string in regular expressions
Diez B. Roggisch
deets.nospaaam at web.de
Thu Oct 21 09:32:37 EDT 2004
More information about the Python-list mailing list
Thu Oct 21 09:32:37 EDT 2004
- Previous message (by thread): Newbie question re "How to Think Like a Computer Scientist"
- Next message (by thread): excluding search string in regular expressions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
>
> A more common solution for detecting functions/Methods would be fine.
Maybe you should go for a real parser here - together with a
C-syntax-grammar. Trying to cram this stuff into regexps is bound for not
catching special cases. And its gereally difficult to have a regexp _not_
macht a certain word.
Another approach would be to look for closing comments and function
definitions in several rexes, and use python-logic:
if doxy_close_rex.match(line):
line = lines.next()
if fun_def_rex.match(line):
....
--
Regards,
Diez B. Roggisch
- Previous message (by thread): Newbie question re "How to Think Like a Computer Scientist"
- Next message (by thread): excluding search string in regular expressions
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list