I\'m trying to create a regular expression to validate usernames against these criteria:
A slight modification to Phillip's answer fixes the latest requirement
^[a-zA-Z0-9]([._](?![._])|[a-zA-Z0-9]){6,18}[a-zA-Z0-9]$