I've written a regular expression to accept alpha (a-z) case insensitive, single quote, or hyphen only.
/^[a-zA-Z'-]+$/
Matches: Marie-Poppins-O'Connor
How can i tweak this further to enforce the following additional rules
- hyphen and single-quote NOT at the beginning or end
- at most one single-quote
- hyphen and quote must not be adjacent to each other (letter must separate them)
Help !
NB: regex dialect is whatever works with JavaScript.