S
Sharun
Python newbie here. I am not clear about how the matching is taking
place when I do the following
I am trying to find the substring starting with 'aaa', and ending with
ddd OR fff. If ddd is found shouldnt the search stop? Shouldn't
re5.search(str5).group(0) return 'aaa bbb\r\n ccc ddd' ?
Thanks
place when I do the following
'aaa bbb\r\n ccc ddd\r\n eee fff'str5 = 'aaa bbb\r\n ccc ddd\r\n eee fff'
re5=re.compile('aaa.*(ddd|fff)',re.S);
re5.search(str5).group(0)
'fff're5.search(str5).group(1)
I am trying to find the substring starting with 'aaa', and ending with
ddd OR fff. If ddd is found shouldnt the search stop? Shouldn't
re5.search(str5).group(0) return 'aaa bbb\r\n ccc ddd' ?
Thanks