Matthew Barnett <pyt...@mrabarnett.plus.com> added the comment: 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. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue2636> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com