× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Have you ever tried the SQL example of Nick Litten?

Snippet:
exec sql
set :myCount = regexp_count( :myEmail,
'^(?:\w+\.?)*\w+@(?:\w+\.)*\w+$');

If myCount = 1;
// email is good
else;
// email is malformed
endif;

Regards,
Karl

-----Ursprüngliche Nachricht-----
Von: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] Im Auftrag von
Pete Helgren
Gesendet: Freitag, 4. Dezember 2020 16:58
An: RPG programming on IBM i
Betreff: Re: Does anyone know of an API to validate an email address?

And my experience is that it is devilishly difficult to get regex for
email validation "just right" for all possible iterations of addresses....

Pete Helgren
www.petesworkshop.com
GIAC Secure Software Programmer-Java
AWS Certified Cloud Practitioner
Twitter - Sys_i_Geek IBM_i_Geek

On 12/4/2020 9:33 AM, David Gibbs via RPG400-L wrote:
On 12/4/20 9:21 AM, Timothy Feldmeier wrote:
I have a screen for the user to enter email addresses. Sometimes they
enter a typo. It would be nice to have an API, instead of writing
code for the validation of an email address.

Are you looking to check the format of the email or the validity of
the address?

There's a regex on my blog post about using REGEX in RPG
(https://www.geekyramblings.net/2020/05/16/regex-in-rpg/) that is
supposed to validate email addresses ... but I've never used it.

There are also web services available that are supposed to validate
email addresses.

david

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 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.