Resolved: How to determine if a username is correct?

In this post, we will see how to resolve How to determine if a username is correct?

Question:

I need to determine if a username in the form of an email ([email protected]) is in the correct form. The necessary parameters for the username being correct are as follows:
  1. there is something before the @ symbol
  2. there is text between the @ symbol and the “.com”
  3. the username ends in .com

These are the only parameters, if they are met the method will return true and if they are all not met it will return false.

Best Answer:

If you have better answer, please add a comment about this, thank you!

Source: Stackoverflow.com