#  Copyright (C) 2024
#  ABM, Moscow
#
#  UNPUBLISHED PROPRIETARY MATERIAL.
#  ALL RIGHTS RESERVED.
#
#  Authors: Mike Orlov <m.orlov@abm-jsc.ru>
import re


def url_to_snake_case(url: str, replacer: str = '_') -> str:
    return re.sub(r'[^a-zA-Z0-9_]+', replacer, url).strip(replacer)
