def regtestli(item, li, match=False):
    """
    Test elements in a list with Regular Expression.
    Extract elements that work well with a Regular Expression (item) from a list(li), and return a result list.
    """
    import re
    c = re.compile(item)
    n = 0
    rs = []
    for i in li:
        if match == True:
            b = re.match(c, i)
            if b is not None:
                rs.append(li[n])
        else:
            b = re.search(c, i)
            if b is not None:
                rs.append(li[n])
        n += 1
    return rs
