All pastes #1348142 Raw Edit

Untitled

public text v1 · immutable
#1348142 ·published 2009-02-26 20:58 UTC
rendered paste body
>>> foo = 'abcdefghijklmnop'
>>> bar = '[aeiou]'
>>> re.findall(bar, foo)
['a', 'e', 'i', 'o']
>>> bar = '([aeiou])|([cd])'
>>> re.findall(bar, foo)
[('a', ''), ('', 'c'), ('', 'd'), ('e', ''), ('i', ''), ('o', '')]
>>> re.finditer(bar, foo)
<callable-iterator object at 0xb7bb568c>
>>> re.finditer(bar, foo)()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: 'callable-iterator' object is not callable