import re


def find_matching_pattern(List, pattern):
    """ Return elements of a list of strings that match a pattern
        and return the first matching group
    """
    reg_pattern=re.compile(pattern)
    MatchedElements=[]
    MatchedStrings=[]
    for l in List:
        match=reg_pattern.search(l)
        if match:
            MatchedElements.append(l)
            if len(match.groups(1))>0:
                MatchedStrings.append(match.groups(1)[0])
            else:
                MatchedStrings.append('')
    return MatchedElements, MatchedStrings