I need to validate a form that a user provides their name and a number. I have a regex that is supposed to make sure the name contains only letters and nothing else and also for the number input i need to make sure only numbers are in the field. The code I have looks like
validator: (value) => value.isEmpty
? 'Enter Your Name'
: RegExp(
'!@#<>?":_``~;[]\|=-+)(*&^%1234567890')
? 'Enter a Valid Name'
: null,
can i get a regex expression that validates a name in such a way if any special character or number is inputted it becomes wrong meaning only letters are valid and another that validates a number in such a way if an alphabetical letter or any special character is inputted it becomes wrong meaning only the input of a number is valid