• Subject: RE: Using regex()
  • From: "Danny Rodius" <danny.rodius@xxxxxxxxx>
  • Date: Wed, 6 Dec 2017 14:07:12 +0100
  • Ironport-phdr: 9a23:EvLdIREd+ufFVmo1wPMhgJ1GYnF86YWxBRYc798ds5kLTJ7yoMuwAkXT6L1XgUPTWs2DsrQf2rqQ6/iocFdDyK7JiGoFfp1IWk1NouQttCtkPvS4D1bmJuXhdS0wEZcKflZk+3amLRodQ56mNBXdrXKo8DEdBAj0OxZrKeTpAI7SiNm82/yv95HJbQhFgDmwbaluIBmqsA7cqtQYjYx+J6gr1xDHuGFIe+NYxWNpIVKcgRPx7dqu8ZBg7ipdpesv+9ZPXqvmcas4S6dYDCk9PGAu+MLrrxjDQhCR6XYaT24bjwBHAwnB7BH9Q5fxri73vfdz1SWGIcH7S60/VjO/4ad2Ux/okDkIOCIl8G/ZjcxwibhUoBOnpxdix4LZb4WYOP94c6jAf90VWHBBU95RWSJfDIOzbZYBAeQCM+lXs4bzqFwArQelCAmwBu7vxSNEimHq0aEk1ekqDAHI3BYnH9ILqHnYotv7O70UUeCzzKjD0CnNb/RL1jf89YjIaR4tquyLUL1ta8XRz08vFgPfglWKrozqIjKV1vkWs2WA9OpgVuKui2g5pAFtuDSg3dkjh5DPi4kIxF7E8iB5z5w0Jd2+UEN7ZN+kH4ZKty6AMYt2Td0tT3t0tyY9z70KoYS0fC0Qx5UmwB7fbeaLfJSP4hLmTOqeOzJ4hXNjeL6lmxay9lCsxfD9Vsauy1lFsDZFncfXtnAWyhzc9suHSuBn8kenxzmPywbe4fxHL0AsjafXNposz7EqmpcRsknPBDL6lUX1gaOMeUgp/PWj5f79bbX8vJCcMpd5igT5MqszhMOyGf84Mg0SX2iD/uS8yaHj8VX5QLpUiv02lbHUvp7AKsQdoK64AxVb35g75xa+CTepzsgYkGEaIF9Bdx+LlYrkNlLULPzlDfqygE6gnThzy/DDJLLhA5HNLnbZkLfmeLZw81NTxxA1zdBZ55NYEKsBIPXuVU/wqdzYFQQ0Mxe3w+fnDtVyyJ8eVXiUDaCHKK/Sq0OH5vozI+mQY48YoCz9K+Aq5/PhkXM1hUYRfa2y0JsSaXC3A+5mLF+fYXrjnNgNC3sFvg07TL+itVuZTDQGZ2quR7luoXY/CZm6FsHGR4y3ibqO0WGwGZgRY2lHDlWFFzDsdp6YWvECb2WIOsA9ymRBUeudTNprmiuWm0fi0b1oNOPR/yweutrk0pBp5+CbtDsXvT08O4S06CbRFzk8l2UEDz4N0bp+rFdJixjJmfxim/METYQW49tMUwsgPJjTwqpxDNWkCSzbedLcAnqvRNO3SQs2QtMs2JVGN0p0HdOzyArE0yu3GJcOlK2NCYBy+K+KjCu5HNp013uTjPpptFIhWMYaaTyr
  • List-archive: <https://archive.midrange.com/rpg400-l/>
  • List-help: <mailto:rpg400-l-request@midrange.com?subject=help>
  • List-id: "RPG programming on the IBM i \(AS/400 and iSeries\)" <rpg400-l.midrange.com>
  • List-post: <mailto:rpg400-l@midrange.com>
  • List-subscribe: <https://lists.midrange.com/mailman/listinfo/rpg400-l>, <mailto:rpg400-l-request@midrange.com?subject=subscribe>
  • List-unsubscribe: <https://lists.midrange.com/mailman/options/rpg400-l>, <mailto:rpg400-l-request@midrange.com?subject=unsubscribe>

Hello,

@ all many thanks for every idea.

Have solved my problem via SQL.

Hereby my pgm. Can be useful for someone else.

**free
ctl-opt main(main) dftactgrp(*no);
dcl-proc main;
dcl-pi main extpgm('STL9110P');
PxEMail char(1024);
PxOK char(1);
end-pi;
dcl-s Count int(10);
dcl-s Email varchar(1024);
exec sql
set option commit = *none,
datfmt = *iso;

Email = PxEMail;
exec sql
values regexp_instr(trim(:Email),
'^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$',
1,
1,
0,
'i')
into :Count;
PxOK = %char(Count);
return;
end-proc;


Again many thanks to all.

BR
Danny
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of David
Gibbs
Sent: dinsdag 5 december 2017 18:43
To: RPG programming on the IBM i (AS/400 and iSeries)
<rpg400-l@xxxxxxxxxxxx>
Subject: Re: Using regex()

On 12/5/2017 8:19 AM, Danny Rodius wrote:
Do you have an example of checking an email address against a regular
expression?

Take a look at https://archive.midrange.com/rpg400-l/201712/msg00039.html

david



--
David Gibbs
midrange.com

IBM i on Power Systems: For when you can't afford to be out of business!

I'm riding 615 miles (Yes, you read that right) in the American Diabetes
Association's Tour de Cure to raise money for diabetes research, education,
advocacy, and awareness. You can make a tax deductible donation to my ride
by visiting https://list.diabetessucks.net.

See where I get my donations from ... visit
https://lsteml.diabetessucks.net/map for an interactive map (it's a geeky
thing).

I may have diabetes, but diabetes doesn't have me!
--
This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link:
http://amzn.to/2dEadiD


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.