import re


def natural_sorter(text_or_path):
    """Split digits from a string for natural sorting."""
    
    substrings = [ int(s) if s.isdigit() else s
                 for s in re.split("(\d+)",str(text_or_path))]
    return substrings