Friend, you only have four expressions to check at the end of the line, right? Therefore, use the first regular expression to validate the username, and then test these four endings with the String functions. It will not consume much more processing time than freaking regular expression.
Try the string.EndsWith () method to check for .., '-', '.' or '-'
source
share