+ 4

Question on python regex

How does .finditer method in python regex works?? Can you give an example?

30th Aug 2020, 6:13 AM
OfcourseitsRohit
OfcourseitsRohit - avatar
1 Answer
+ 6
It is not very difficult! It has features of search as well as findall In search => we can get only the first match's starting and ending In findall => we get only the number of times a particular substring is coming (their starting and ending points are unknown) But in finditer, we can find all the occurrence of a particular substring and also get their starting and ending points! https://code.sololearn.com/cF4l7j1htFRc/?ref=app
30th Aug 2020, 8:07 AM
Namit Jain
Namit Jain - avatar