We are using below regular expression to validate email address in java ^[\\w!#\\$'\\*\\+=\\?\\^\\/_~-]+(\\.[\\w!#\\$'\\*\\+=\\?\\^\\/_~-]+)*@([a-zA-Z0-9\\-]+\\.)+[A-Z]{2,4}$
and it worked fine with invalid email address raju.rathi@gmail.com&^(*&^(*^2
but when I use the same regular expression in javascript , it doesn't work and failes with even valid email addresses . Please suggest what could be root cause of this mismatch?
for e.g. in javascript , I'm getting false value with below test conditional -
/^[\w!#\$'\*\+=\?\^\/~-]+(\.[\w!#\$'\*\+=\?\^\/~-]+)*@([a-zA-Z0-9\-]+\.)+ [A-Z]{2,4}$/.test("raju.rathi@gmail.com")