def METHOD_NAME(user_agent: str) -> Optional[str]:
    if re.search(r"\b Android \b", user_agent, re.I | re.X):
        return "android"
    if re.search(r"\b(?: iOS | iPhone\ OS )\b", user_agent, re.I | re.X):
        return "ios"
    return None