R
Robert Oschler
I figured I'd utter some words of praise for re.finditer(). It's such a
great feeling, when you come across a single statement that does everything
you want in two lines of code:
for g in re.finditer(pattern, string):
do_something_to_g(g)
In two lines of code I can break out all the sub-strings I need with a
regular expressions pattern, and have each of them operated upon by a
function.
Nice.
[Note: Python 2.2.3 or better is needed to use re.finditer()]
great feeling, when you come across a single statement that does everything
you want in two lines of code:
for g in re.finditer(pattern, string):
do_something_to_g(g)
In two lines of code I can break out all the sub-strings I need with a
regular expressions pattern, and have each of them operated upon by a
function.
Nice.
[Note: Python 2.2.3 or better is needed to use re.finditer()]