I am new to regex. I need a regex pattern to validate the input text field that can accept string without special character. If "@" is added it should validate for email field. I have tried with following.
[a-zA-Z0-9\s._-]{3,}(?(?=@)[a-z0-9.-]+\.[a-z]{2,3}|$