![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.python archiveRe: \l operation in regular expressions
From: Fredrik Lundh <fredrik@pythonware.com>
Date: Tue May 24 2005 - 16:40:16 CEST
"Kalle Anka" <skromta@gmail.com> wrote:
> I've started to play around with regexps in Python and I tried
they're not mentioned in the RE syntax chapter, and they don't work, so "not
> It doesn't look like it supported? What is the "Python way" of doing this,
def fixup(m):
or, if you insist on writing one-liners:
s = re.sub( r'(\bw\w+\b)', lambda m: m.group().capitalize(), 'will it work')
</F>
|