validate_email = ( email ) ->
(/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/).test email
This works, but it fails my "max line length" test at 79 characters, so I've been trying to cut it down to less than 80 characters (actually max 74) using the example at coffeescript.org:
RFC822 = /// ^ (
([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+
| \x22([^\x0d\x22\x5c\x80-\xff]
| \x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a
-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+
| \x22([^\x0d\x22\x5c\x80-\xff]
| \x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a
-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+
| \x5b([^\x0d\x5b-\x5d\x80-\xff]
| \x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a
-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+
| \x5b([^\x0d\x5b-\x5d\x80-\xff]
| \x5c[\x00-\x7f])*\x5d))*$/
) ///
RFC822.test email
Although this compiles just fine, it isn't working. It always returns false.
How do I do this?