tenderlove/rails_autolink — pull request #31 by andresbravog (2013-09-05 08:54:01+00:00)
Title: Improved email regex to allow especial chars

As is defined in RFC 5322 (http://tools.ietf.org/html/rfc5322) and RFC 6531 (http://tools.ietf.org/html/rfc6531) some especial chars are allowed in email addresses

* [x] Characters !#$%&'*+-/=?^_`{|}~ (ASCII: 33, 35–39, 42, 43, 45, 47, 61, 63, 94–96, 123–126)
* [x] Character . (dot, period, full stop) (ASCII: 46)

## TODO

* [ ] Special characters are allowed with restrictions. They are:
* Space and "(),:;<>@[\] (ASCII: 32, 34, 40, 41, 44, 58, 59, 60, 62, 64, 91–93)

```
The restrictions for special characters are that they must only be used when contained between quotation marks, and that 2 of them (the backslash \ and quotation mark " (ASCII: 92, 34)) must also be preceded by a backslash \ (e.g. "\\\"").
````

* [ ] Comments are allowed with parentheses at either end of the local part; e.g. "john.smith(comment)@example.com" and "(comment)john.smith@example.com" are both equivalent to "john.smith@example.com".

* [ ] International characters above U+007F are permitted by RFC 6531, though mail systems may restrict which characters to use when assigning local parts.