So I have the following requirements:
- Any alphabets between a-z or A-Z
- The first character must be alphabet
- No numeric characters are allowed
- No special characters are allowed except these three: .-‘
- And they can only be in between letters
So far, to solve this I have got the 2 following regex:
^[a-zA-Z][a-zA-Z ]*$
This is to solve points 1,2,3
(?<=[a-zA-Z])[.\-'](?=[a-zA-Z])
and this is to solve points 4,5
Test cases can be words like:
- abc (pass)
- abc's (pass)
- abc' (fail)
- abc ' (fail)
However I am unable to combine them. I have tried and I do not get the expected outcome. Any ideas?