import re


def _split_text_by_delimeter(pattern, text):
    """
    Splits text into parts separated by delimeter that matches `pattern`.
    Delimeter is not included in the returned texts.
    For example, --pattern='\n\n---------\n\n' may be used if 
    chapter are separated by 8 dashes.
    """
    texts = re.split(pattern, text)

    if len(texts) == 0:
        print(f'\n❗ No text matching pattern "{pattern}". Splitting is not performed.\n')

    return texts