Author mrabarnett
Recipients akuchling, amaury.forgeotdarc, collinwinter, ezio.melotti, georg.brandl, jaylogan, jimjjewett, loewis, mark, moreati, mrabarnett, nneonneo, pitrou, rsc, timehorse
Date 2009-03-22.23:33:29
SpamBayes Score 2.13192e-05
Marked as misclassified No
Message-id <1237764811.45.0.185862244587.issue2636@psf.upfronthosting.co.za>
In-reply-to
Content
An additional feature that could be borrowed, though in slightly
modified form, from Perl is case-changing controls in replacement
strings. Roughly the idea is to add these forms to the replacement string:

    \g<1> provides capture group 1

    \u\g<1> provides capture group 1 with the first character in uppercase

    \U\g<1> provides capture group 1 with all the characters in uppercase

    \l\g<1> provides capture group 1 with the first character in lowercase

    \L\g<1> provides capture group 1 with all the characters in lowercase

In Perl titlecase is achieved by using both \u and \L, and the same
could be done in Python:

    \u\L\g<1> provides capture group 1 with the first character in
uppercase after putting all the characters in all lowercase

although internally it would do proper titlecase.

I'm suggesting restricting the action to only the following group. Note
that this is actually syntactically unambiguous.
History
Date User Action Args
2009-03-22 23:33:31mrabarnettsetrecipients: + mrabarnett, loewis, akuchling, georg.brandl, collinwinter, jimjjewett, amaury.forgeotdarc, pitrou, nneonneo, rsc, timehorse, mark, ezio.melotti, jaylogan, moreati
2009-03-22 23:33:31mrabarnettsetmessageid: <1237764811.45.0.185862244587.issue2636@psf.upfronthosting.co.za>
2009-03-22 23:33:29mrabarnettlinkissue2636 messages
2009-03-22 23:33:29mrabarnettcreate