'Bad Escapement' on line declaring RegEx
the line declaring a RegEx for checking an email:
var rgx = RegExp("/^([a-zA-Z0-9_-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$/");
is throwing a warning during Titanium building process
[WARN] JavaScript compiler reported "Bad escapement." at pages/login_form.js:51
any tips on how to get it to stop? I know it's just a warning, but warnings mean "bad code" and i don't want to pick up any bad habits
1 Answer
-
hmm.. switching to "literal" format worked
var rgx = /^([a-zA-Z0-9_-.]+)@(([[0-9]{1,3}.[0-9]{1,3}.[0-9]{1,3}.)|(([a-zA-Z0-9-]+.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(]?)$/;
no warning for that