|
On Fri, 21 Nov 2003, Scott Johnson wrote: > I asked about email validation a few weeks ago. And it can become a very deep > subject in a hurry. Everybody has their own way of doing it. The best way to > do it is to use something called Regular Expression. Which RPGIV does not > currently support. First of all, I disagree that a Regular Expression is the "best" way to do this. In fact, I'd be willing to wager that your regular expression does not correctly handle the e-mail address. Second, you CAN use Regular Expressions in RPG by calling the RegComp, RegExec, etc routines from the ILE C runtime library. > I did eventually find some Delphi code that was very promising. I took > that and converted it to RPG IV. Below are the results. Now this just > does "syntax" checking. It will not check if the email address is really > valid. I have not thoroughly checked this code to make sure it works in > ALL cases, but it has work for me so far. So if you find any bugs or > such, please let me know. Actually, that code looks pretty good... I'm not going to fully analyze it and compare it against the standards, but the state machine that it uses appears to take things like quotes into account, which means that it'll work much better than the Regular Expression methods that I've seen. You might be interested in that VALMAIL service program that I mentioned earlier in this thread. It does more or less the same thing that your validation program is doing, except that it also looks up the domain name and makes sure that it exists... http://www.iseriesnetwork.com/resources/clubtech/index.cfm?fuseaction=ShowNewsletterIssue&ID=17632 Good Luck
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.