def aliasSub(requestContext, seriesList, search, replace):
    """
    Runs series names through a regex search/replace.

   Example::

        &target=aliasSub(ip.*TCP*,"^.*TCP(\d+)","\\1")
    """
    try:
        seriesList.name = re.sub(search, replace, seriesList.name)
    except __HOLE__:
        for series in seriesList:
            series.name = re.sub(search, replace, series.name)
    return seriesList
dataset/ETHPy150Open brutasse/graphite-api/graphite_api/functions.py/aliasSub