import re


def normalize(name):
  """Returns a name suitable for a filename."""
  name = re.sub(r'[^a-z0-9]', ' ', name.lower())
  name = re.sub(r'\s+', '-', name.strip())
  if not name:
    name = 'untitled'
  return name