implement text.extract_iter
This commit is contained in:
@@ -99,6 +99,14 @@ def extract_all(txt, rules, pos=0, values=None):
|
|||||||
values[key] = result
|
values[key] = result
|
||||||
return values, pos
|
return values, pos
|
||||||
|
|
||||||
|
def extract_iter(txt, begin, end, pos=0):
|
||||||
|
"""Yield all values obtained by repeated calls to text.extract"""
|
||||||
|
while True:
|
||||||
|
value, pos = extract(txt, begin, end, pos)
|
||||||
|
if value is None:
|
||||||
|
return
|
||||||
|
yield value
|
||||||
|
|
||||||
if platform.system() == "Windows":
|
if platform.system() == "Windows":
|
||||||
clean_path = clean_path_windows
|
clean_path = clean_path_windows
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user