I'm getting a syntax error in this simple javascript code. I just want to check the atring on a pattern. Can any one tell me what is wrong?
var a = 'test@server.com';
var pattern = [a-zA-Z0-9_]+[.[a-zA-Z0-9]+]*@[a-zA-Z0-9_]+[.[a-zA-Z]+]+;
console.log('The comparison is ',a.match(pattern));
Thanks.