I have a requirement that validates the user input.
- only input
a-z
,A-Z
,'
, '-' and blanks. a-z
,A-Z
should appear at least once.
In other words:
- 'test user' --> True
- 'test1user' --> False
- ' test user' -' --> True
- ' ' --> False
- ' ' - ' --> False
I tried one way like ^[(A-Za-z)? '-]+$
, but not work.
Any other solutions?