import re


def clean_source(s):
  """
  Given a URL string,
  return an escaped regular expression for matching that string.
  Only forward-slashes are not escaped.
  """
  r = s.strip()
  r = re.escape(r)
  r = r.replace('\\/', '/')
  return r