I have this Regex I modified to allow underscores, hyphen, letters and numbers. I am trying to modify it further so that it has the following properties:
^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9_-]*[a-zA-Z0-9])$
Either one of the three possibilities:
[a-zA-Z0-9]
[a-zA-Z0-9][a-zA-Z0-9]
[a-zA-Z0-9][a-zA-Z0-9_-]*[a-zA-Z0-9]