def escapeNewlinesCallback(u_match):
    """
	u_match: instance of _sre.SRE_Match
	"""
    ch = u_match.group(0)
    if ch == '\n':
        return '\\n'
    if ch == '\r':
        return '\\r'
    if ch == '\\':
        return '\\\\'
    return ch
