import re


def _CreateLegalIdentifier(input_string):
  """Converts input_string to a legal identifier for ADMX/ADML files.

  Changes some characters that do not necessarily cause problems and may not
  handle all cases.

  Args:
    input_string: Text to convert to a legal identifier.

  Returns:
    String containing a legal identifier based on input_string.
  """
  return re.sub(r'[\W_]', '', input_string)