def clean_name(self):
        name = self.cleaned_data['name']
        if not re.match(r'^[a-zA-Z0-9-_]+$', name):
            raise forms.ValidationError(
                _("Sorry, field names can only contain letters, numbers, hyphens (-) and underscores (_)"))
        return name
Ensure the name of the field only contains alphanumeric
dataset/ETHPy150Open treeio/treeio/treeio/infrastructure/forms.py/ItemFieldForm.clean_name