On 4/21/2011 6:16 AM, Neil Cerutti wrote:
On 2011-04-20, John Naglena...@animats.com wrote:
Findall does something a bit different. It returns a list of
matches of the entire pattern, not repeats of groups within
the pattern.
Consider a regular expression for matching domain
On 2011-04-20, John Nagle na...@animats.com wrote:
Findall does something a bit different. It returns a list of
matches of the entire pattern, not repeats of groups within
the pattern.
Consider a regular expression for matching domain names:
kre =
2011/4/20 John Nagle na...@animats.com:
Here's something that surprised me about Python regular expressions.
krex = re.compile(r^([a-z])+$)
s = abcdef
ms = krex.match(s)
ms.groups()
('f',)
...
If a group is contained in a part of the pattern that matched multiple
times, the last match
2011/4/20 MRAB pyt...@mrabarnett.plus.com:
On 20/04/2011 20:20, John Nagle wrote:
Here's something that surprised me about Python regular expressions.
...
You should take a look at the regex module on PyPI. :-)
--
Ah well...
sorry for possibly destroying the point and the aha! effect ...
Here's something that surprised me about Python regular expressions.
krex = re.compile(r^([a-z])+$)
s = abcdef
ms = krex.match(s)
ms.groups()
('f',)
The parentheses indicate a capturing group within the
regular expression, and the + indicates that the
group can appear one or more times.
On 2011-04-20, John Nagle na...@animats.com wrote:
Here's something that surprised me about Python regular expressions.
krex = re.compile(r^([a-z])+$)
s = abcdef
ms = krex.match(s)
ms.groups()
('f',)
The parentheses indicate a capturing group within the
regular expression, and the +
On 20/04/2011 20:20, John Nagle wrote:
Here's something that surprised me about Python regular expressions.
krex = re.compile(r^([a-z])+$)
s = abcdef
ms = krex.match(s)
ms.groups()
('f',)
The parentheses indicate a capturing group within the
regular expression, and the + indicates that
On 4/20/2011 12:23 PM, Neil Cerutti wrote:
On 2011-04-20, John Naglena...@animats.com wrote:
Here's something that surprised me about Python regular expressions.
krex = re.compile(r^([a-z])+$)
s = abcdef
ms = krex.match(s)
ms.groups()
('f',)
The parentheses indicate a capturing group