import re


def prefix_match(string, prefix=None):
    """Check if the string matches the given prefix"""
    if prefix is None or len(prefix) == 0:
        return True
    return re.match(f'({prefix})+(.*?)', string) is not None