Added character validation for custom defines