I am referring to the documentation of the re.findall
function:
What is the meaning of "Empty matches are included in the result."?
This happen when you use groups that matches empty string , example:
print(re.findall(r'(\w)(\d?)(\w)', "bc"))
OUPUT:
[('b', '', 'c')]
Here group (\d?)
matches ''
and is included in the result.
It just means when the match is “” or an empty string, that it is included in the list of results.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With