When I write the following code:
m = re.findall('\sf.*?\s','a f fast and friendly dog');
I get the output :[' f ', ' friendly ']
But when I provide extra space between f and fast, I get the following output, which I expected from the previous one. The code is as follows
m = re.findall('\sf.*?\s','a f fast and friendly dog');
Output:
[' f ', ' fast ', ' friendly ']
Can someone tell me why I am not getting a later output in the first case (without inserting extra space between f and fast)?
source
share