import re


def search_for_perf_sections(txt):
    """
    Returns all matches in txt for performance counter configuration
    sections
    """
    perf_src_srch_str = r'\n<source>\n  type oms_omi.*?object_name "(.*?)".*?instance_regex "(.*?)".*?counter_name_regex "(.*?)".*?interval ([0-9]+[a-z])(.*?)</source>\n'
    # Since this search uses re.S, newlines and omi_mapping_path will be
    # matched
    perf_src_srch = re.compile(perf_src_srch_str, re.M | re.S)
    return perf_src_srch.findall(txt)