<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def platform(self, with_prompt, platforms=None):
 """Return the platform name based on the prompt matching."""

        if platforms is None:
            platforms = self._dict['generic']['prompt_detection']

        for platform in platforms:
            pattern = self.pattern(platform, 'prompt')
            result = re.search(pattern, with_prompt)
            if result:
                return platform
        return None