SRE incompatibility
regexp = '(([a-z]+):)?([a-z]+)$' import re re.match(regexp, 'smil').group(0,1,2,3) ('smil', None, 's', 'smil') import pre pre.match(regexp, 'smil').group(0,1,2,3) ('smil', None, None, 'smil')
Needless to say, I am relying on the third value being None... (My regular expression was actually more like '(?:(?P<prefix>[a-z]+):)?(?P<suffix>[a-z]+)$' and I check for result.group('prefix')) -- Sjoerd Mullender <sjoerd.mullender@oratrix.com>
sjoerd wrote:
re.match(regexp, 'smil').group(0,1,2,3) ('smil', None, 's', 'smil') import pre pre.match(regexp, 'smil').group(0,1,2,3) ('smil', None, None, 'smil')
Needless to say, I am relying on the third value being None...
I've confirmed this (last night's fix should have solved this, but it didn't). I'll post patches as soon as I have them... </F>
Is this problem ever going to be solved or is it too hard? If it's too hard, I can fix xmllib to not depend on this. This incompatibility is the only reason I'm still not using sre. In case you don't remember, the regexp that is referred to is regexp = '(([a-z]+):)?([a-z]+)$' On Wed, Jul 5 2000 "Fredrik Lundh" wrote:
sjoerd wrote:
re.match(regexp, 'smil').group(0,1,2,3) ('smil', None, 's', 'smil') import pre pre.match(regexp, 'smil').group(0,1,2,3) ('smil', None, None, 'smil')
Needless to say, I am relying on the third value being None...
I've confirmed this (last night's fix should have solved this, but it didn't). I'll post patches as soon as I have them...
</F>
-- Sjoerd Mullender <sjoerd.mullender@oratrix.com>
participants (2)
-
Fredrik Lundh
-
Sjoerd Mullender