I'm using the expand method of re MatchObjects, and was surprised to
find that the references don't work with group 0...
[color=blue][color=green][color=darkred]
>>> import re
>>> p = re.compile('foo ')
>>> m = p.match('foo')
>>> m.group(0)[/color][/color][/color]
'foo'[color=blue][color=green][color=darkred]
>>> m.expand('\\0')[/color][/color][/color]
'\x00'
Is this intended behavior? Why should group 0 behave differently from
the others?
--
Magnus Lie Hetland "The mind is not a vessel to be filled,
http://hetland.org but a fire to be lighted." [Plutarch]
find that the references don't work with group 0...
[color=blue][color=green][color=darkred]
>>> import re
>>> p = re.compile('foo ')
>>> m = p.match('foo')
>>> m.group(0)[/color][/color][/color]
'foo'[color=blue][color=green][color=darkred]
>>> m.expand('\\0')[/color][/color][/color]
'\x00'
Is this intended behavior? Why should group 0 behave differently from
the others?
--
Magnus Lie Hetland "The mind is not a vessel to be filled,
http://hetland.org but a fire to be lighted." [Plutarch]
Comment