import re


def _get_path_name_ext(filepath: str):
    """Parses out path, filename and extension of the given file"""
    dir_path, f1, f2, ext = re.compile(r'(?:(.*[\/])(.+)|^(.+))\.((?:md|html|ipynb))').findall(filepath)[0]
    filename = f1 + f2  # alternative groups, one will be empty one with filename
    return dir_path, filename, ext