I use this regex in Rails to check that an email address contains the basic parts:
/.+@.+\..+/i
I'm trying to translate that to javascript to do the same validation client side. I've tried a method given here on SO:
var translated_regex = /.+@.+\\..+/i
and the gem js_regex:
var translated_regex = /.+@.+\\..+/
But translated_regex.test('[email protected]') don't work in neither of those cases.
What am I doing wrong or miss here?