import re

def fits_pattern(string):
    if 4 <= len(string) <= 25 and '--' not in string and not string.startswith(
        '-') and not string.endswith('-'):
        pass
Regex for [a-zA-Z0-9\-] with dashes allowed in between but not at the start or end