I thank you for your help. The more flexible solution (Paul McGuire) is interesting but i don't need such a flexibility. In fact I am implementing a cross-reference tool and working on python sources, I don't need the '.' as separator in order to capture variables and commands. I thank nevertheless Paul for the advice on using pyparsing.
The other two solutions (Thomas Guettler and Fredrik Lundh) are quite similar except for the use of "raw". I can use both. -- http://mail.python.org/mailman/listinfo/python-list