Extract names around each word regex
Question: There is a string

    
    
    Mary loves Mike,Jack loves Lily,Ethan loves Lydia
    

I want to extract the names around each `loves` with python.But the code below
can't work.

    
    
    names = re.search(r'(\S+) loves (\S+)',str, ) 
    while names: 
        print names.group(1) 
        print names.group(2)
    


Answer: 
    >>> import re
    >>> re.findall(r"([a-zA-Z]+) loves ([a-zA-Z]+)", "Mary loves Mike,Jack loves Lily,Ethan loves Lydia")
    [('Mary', 'Mike'), ('Jack', 'Lily'), ('Ethan', 'Lydia')]
    

