def replace_text(file_text, substitution_map=None, replacement_map=None):
    """
        a method to replace values in a file text

    :param substitution_map: [optional] dictionary with regex substitution pattern key pairs
    :param replacement_map: [optional] dictionary with replacement text key pairs
    :return: string with text with replacement fields
    """
    import re
    if substitution_map:
        for key, value in substitution_map.items():
            regex_pattern = re.compile(key, re.S)
            file_text = regex_pattern.sub(value, file_text)
    if replacement_map:
        for key, value in replacement_map.items():
            file_text = file_text.replace(key, value)
    return file_text
