Removes trailing and leading backslashes from string

def _stripslashes(s):
  '''Removes trailing and leading backslashes from string'''
  r = re.sub(r"\\(n|r)", "\n", s)
  r = re.sub(r"\\", "", r)
  return r