We have special requirements for our email verification. We want to allow the following:
- First and last characters must be alphanumeric.
- The middle section also allows alphanumeric + the following 3 special characters
.-_
(period, hyphen and underscore). - Special characters cannot touch (2 periods cannot be next to eachother, or a hyphen underscore for instance).
So far I've managed to figure our how to check for alphanumeric: [^A-Za-z0-9 ]
But I'm completely stuck on the hardest part - the middle section. Thanks.