import re


def findall_sub(pattern, repl, string, count=0, flags=0):
    """ Call findall and sub, and return a tuple: newString, matches """
    newString = string
    matches = re.findall(pattern, string, flags)
    if (matches) :
        newString = re.sub(pattern, repl, string, count, flags)
    return newString, matches