def ConstructNameFilterExpression(requested_name_regexes):
  """Construct a name filter expression.

  Args:
    requested_name_regexes: A list of name regular expressions that can
      be used to filter the resources by name on the server side.

  Returns:
    A string expression suitable for the requested names, or None if
    requested_name_regexes is None.
  """
  if requested_name_regexes:
    if len(requested_name_regexes) == 1:
      return 'name eq {0}'.format(requested_name_regexes[0])
    else:
      regexes = []
      for regex in requested_name_regexes:
        regexes.append('({0})'.format(regex))
      return 'name eq {0}'.format('|'.join(regexes))
  else:
    return None