-4

I have no experience with regular expressions in java script, but I need to derive a pattern for [email protected]. There only needs to be a pattern for FMLast1234 because @ung.edu needs to remain the same. I am not sure if I just do this \b[a-z][a-z][a-z][0-9] or what. Does there need to be a range for each character in the pattern? I need to check for variations of the pattern FMLast1234 not just a random assortment of characters and numbers.

nhahtdh
  • 55,989
  • 15
  • 126
  • 162
Inquirer
  • 7
  • 6
  • Do you explicitely want to check for variations of that specific format `FMLast1234` or you just want to allow any mix of alphanumeric characters? – plalx Oct 29 '13 at 14:32
  • I need to check for variations of that specific format. F stands for first letter of first name M is is first letter of middle name and last is first four of last name and then an id number. – Inquirer Oct 29 '13 at 15:06

1 Answers1

0
/[a-zA-Z0-9]@ung.edu/.test("[email protected]")  or  

if(emailString.split('@')[1] === "ung.edu")

Edit : As per plalx comment here is my answer

 /^\[email protected]$/.test("[email protected]")
Exception
  • 8,111
  • 22
  • 85
  • 136