def search(text, untranslate=False, capitalize=True, filters=[]):
    """Search for a `text` string in the resources entries.
    `filters` is a list of strings: they must be parts before the '=' sign in the resource files, or parts of.
    `filters` may be regexes.
    Returns a sorted list of matching elements."""
    # filters may contain regexes
    text = text.lower()
    results = []
    def get_result(l, w):
            if untranslate:
                if capitalize:
                    results.append('-'.join([b.capitalize() for b in ' '.join([a.capitalize() for a in serNe[w].split(' ')]).split('-')]))
                else:
                    results.append(serNe[w].lower())
            else:
                if capitalize:
                    results.append('-'.join([b.capitalize() for b in ' '.join([a.capitalize() for a in l.split(' ')]).split('-')]))
                else:
                    results.append(l.lower())
    for k, v in serGnal.items():
        if text in k.lower():
            if not filters or map(lambda (x,y):re.match(x,y), zip(filters, [v] * len(filters))) != [None, None]:
                if untranslate:
                    if capitalize:
                        results.append('-'.join([b.capitalize() for b in ' '.join([a.capitalize() for a in serNe[v].split(' ')]).split('-')]))
                    else:
                        results.append(serNe[v].lower())
                else:
                    if capitalize:
                        results.append('-'.join([b.capitalize() for b in ' '.join([a.capitalize() for a in k.split(' ')]).split('-')]))
                    else:
                        results.append(k.lower())
    results.sort()
    return results
Search for a `text` string in the resources entries.
    `filters` is a list of strings: they must be parts before the '=' sign in the resource files, or parts of.
    `filters` may be regexes.
    Returns a sorted list of matching elements.
mclangres.py