I have the following regex condition for email address.
var value = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9]+\.[a-zA-Z{2,}$/
But I dont want the name to start or end with period(.) or underscore(_) or hyphen (-) and this given special characters should include in middle only.
for eg :
_name.name_@email.com Invalid
-name.name-@email.com Invalid
name.@email.com Invalid
name_@email.com Invalid
name-@email.com Invalid
.name@email.com Invalid
_name@email.com Invalid
-name@email.com Invalid
name.name@email.com Valid
name_name@email.com Valid
name-name@email.com Valid
I am trying to figure out the solution and learn in the process.