Question
Custom validation to ensure that text entry email address contains specific domain
I have a text entry field where users enter an email address. The email address must always end with "@bsu.edu" and include between 3 and 12 characters (letters and numbers) for the username portion. The username cannot contain any special characters or symbols. I presume I will need to use RegEx to check for valid email addresses but I'm having difficult understanding how to write an appropriate RegEx pattern.
I have written the following pattern but the validation still passes when a user can enter more than 12 characters/numbers before the "@bsu.edu"
/^[A-Z0-9]{3,12}(@bsu.edu)$/gi
What am I missing that limit the character/digit count for the username portion to a maximum 12 characters/numbers?
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.
