Subject | Re: [firebird-support] Why this similar to is wrong? |
---|---|
Author | Ivan Arabadzhiev |
Post date | 2014-11-25T14:15:53Z |
Technically speaking, there are things out there like http://www.ex-parrot.com/pdw/Mail-RFC822-Address.html (just to show, that very very few people do an actually 100% correct email validation)
2014-11-25 15:39 GMT+02:00 Tim Ward tdw@... [firebird-support] <firebird-support@yahoogroups.com>:
On 25/11/2014 13:29, sirhamacker@... [firebird-support] wrote:
Well, just a couple of general observations:select
iif('email@...' similar to '([_a-zA-Z\d\-\.]+@[_a-zA-Z\d\-]+(\.[_a-zA-Z\d\-]+)+)','ok','fail')
from rdb$database
Says 'invalid string' and 'invalid pattern', but the pattern it´s the same in other languages for validate email address.
- there is no such thing as a regular expression that can validate an email address, at best you can get an approximation that works "quite often" but still gets it wrong sometimes
- there are dozens of languages all with slightly different rules for regular expressions, it's not a surprise if any non-trivial regular expression needs changing between languages, you just have to read the rules for the new language.
-- Tim Ward