re.Scanner - match python dot notation
ckkart at hoc.net
Mon Feb 7 19:53:04 CET 2011
Am 07.02.11 17:47, schrieb MRAB:
> On 07/02/2011 15:34, Christian K. wrote:
>> I am trying to find a regexp to be used with re.Scanner that matches the
>> 'package.module.member' syntax. More specifically I want to parse
>> function strings like
>> and sort out variables/constants.
>> This one here works using re.match but fails when used with Scanner (due
>> to the grouping () I guess).
>> I highly appreciate your comments.
>> Regards, christian
> I'm not sure about your regex, but I'd probably use this:
Perfect, thanks. I changed the last * to a + so that the string must
contain a '.' to match.
More information about the Python-list