import re

import poobrains

def valid_name(value):
    if re.search('^[a-z0-9_\-]+$', value) is None:
        raise poobrains.errors.ValidationError(r"Not a valid name: '{value}', can only contain a-z, 0-9, '-', '_'.")
