I have a regex /^([A-Za-zs-']{1,})$/
This accepts alphabets, hyphen and apostrophes.
- Having multiple spaces at the beginning of the string,in the middle and the end of the string is fine.
- "Henry - Jackson's Derby-'s" is also correct
I have only one problem to be fixed in this regex.
"If I enter only empty spaces in the input field it accepts that as well" - which is wrong
How can I avoid this?
question from:https://stackoverflow.com/questions/65937012/only-empty-spaces-should-not-be-allowed-in-the-input-field