Regular Expression

Hi All,

Please find the attach screenshot of a example of Regular Expression.

Can anyone explain me that how t+ giving three time “t” in o/p>

Screenshot 2020-05-21 at 9.10.52 AM

Hi Charu,

re.findall() will find all the occurrences of the pattern in the string.

re.findall(‘t+’, string) will find all the occurrences of t+, i.e, (either t, tt, ttt, etc.) in the string.

string = ‘this is a aa and that is a aaa’.

In the above string, first t is at index 0. Second t is at index 17 and third is at index 20.


1 Like