Python regular expression findall *
I am not able to understand the following code behavior. >>> import re >>> text = 'been' >>> r = re.compile(r'b(e)*') >>> r.search(text).group() 'bee' #makes sense >>> r.findall(text) ['e'] #makes no sense I read some already existing question and answers about capturing groups and all. But still I am confused. Could someone please explain me. The answer is simplified in the Regex Howto As you can read here , group returns the string matched by the Regular Expression. group() returns the substring that was matched by the RE. But the action of findall is justified in the documentation If one or