import re


def find_nodes_with_matching_text(page,xpath,regex):
    """
    Using an lxml node, find matching xpath results that have text content
    matching the regex that is passed in here.
    """
    xpath_matches = page.xpath(xpath)
    results = []
    for xp in xpath_matches:
        if re.search(regex,xp.text_content()):
            results.append(xp)
    return results