This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author niemeyer
Recipients
Date 2006-11-06.12:17:03
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=7887

Hello Thomas,

I don't understand exactly what you mean here.

This doesn't work:

  >>> re.compile("([0-9])([a-z])?").subn(r"<\1\2>", "1 1a")
  Traceback (most recent call last):
  ...
  sre_constants.error: unmatched group

And this works fine:

  >>> re.compile("([0-9])([a-z]?)").subn(r"<\1\2>", "1 1a")
  ('<1> <1a>', 2)

The example code you provided doesn't run here, because
'subn()' is being provided
bad data (check http://docs.python.org/lib/node46.html for
docs). It's also
being passed '\1\2', which is really '\x01\x02', and won't
do what you want.
History
Date User Action Args
2007-08-23 14:49:31adminlinkissue1591319 messages
2007-08-23 14:49:31admincreate