String.prototype.is_email = function() {
return this.match(/[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+(?:[A-Z]{2}|com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum)\b/);
};
I'm trying to get all my javascript files to lint under closure linter ( http://code.google.com/closure/utilities/docs/linter_howto.html ); how do I break up a Regular Expression using the /regex/ syntax.
Line 24, E:0110: Line too long (200 characters). Found 1 errors, including 0 new errors, in 1 files (0 files OK).
You can use the RegExp(pattern, modifiers) and pass the pattern as a string. The string can be built up in small parts using concatenation.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With