Open florisla opened 4 years ago
Since 1.8.2, it's possible to go the other way round:
for m in parse.findall(some_format, text, evaluate_result=False): # Notice 'evaluate_result=False'
m.match.span() # <-- This provides access to re.Match.span field hence the whole match span
m.evaluate_result() # <-- This returns variables captured in format string
I would find it useful if I could query
Just like I can get the
span
tuple information of individual fields (result.spans['field']
).I realize "span" name-clashes a bit with the
spans
propery; perhaps it could be calledfull_span
?Edit: the purpose is to make replacing text easier -- see #100.