:
On 20 October 2012 20:22, Dennis Lee Bieber wlfr...@ix.netcom.com wrote:
Based on the documentation, most of that pattern is fluff: (?#...)
is considered a comment.
The comment isn't entirely fluff ... it provides a Google target for
whoever's marking OP's assignment, should they
the pattern `re.compile(.(?#nyh2p){0,1})` , make me confused,
can you explain how it can match the first letter of every word?
2012/10/20 Dennis Lee Bieber wlfr...@ix.netcom.com
On Sat, 20 Oct 2012 01:03:46 -0400, Zero Piraeus sche...@gmail.com
declaimed the following in
On Sat, Oct 20, 2012 at 5:14 PM, contro opinion contropin...@gmail.com wrote:
the pattern `re.compile(.(?#nyh2p){0,1})` , make me confused,
can you explain how it can match the first letter of every word?
It doesn't.
pattern = re.compile(.(?#nyh2p){0,1})
pattern.findall(a test of
On 2012-10-21 00:14, contro opinion wrote:
the pattern `re.compile(.(?#nyh2p){0,1})` , make me confused,
can you explain how it can match the first letter of every word?
It matches all of the characters, plus an empty string at the end. It's
equivalent to:
result =
for c in a test
On Sat, Oct 20, 2012 at 1:30 PM, Dennis Lee Bieber
wlfr...@ix.netcom.com wrote:
for match in re.findall(pattern, a test of capitalizing):
... result = f(result + match)
result = result + f(match)
Or closer... Don't both with f and str.capitalize
result = result +
how can i use regular expression in python to change the string
a test of capitalizing
into
A Test Of Capitalizing?
--
http://mail.python.org/mailman/listinfo/python-list
On 10/20/2012 12:09 AM, contro opinion wrote:
how can i use regular expression in python to change the string
a test of capitalizing
into
A Test Of Capitalizing?
is that (regex) part of the assignment, or just how you assumed you'd
want to do it?
There is a str method already called
:
On 20 October 2012 00:09, contro opinion contropin...@gmail.com wrote:
how can i use regular expression in python to change the string
a test of capitalizing
into
A Test Of Capitalizing?
import re
pattern = re.compile(.(?#nyh2p){0,1})
result =
f = str.title
for match in