× 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.


  • Subject: RE: Using regex()
  • From: "Danny Rodius" <danny.rodius@xxxxxxxxx>
  • Date: Wed, 6 Dec 2017 10:04:05 +0100
  • Ironport-phdr: 9a23:MemAIBRj1HVCTgTIeX/s9qm9wtpsv+yvbD5Q0YIujvd0So/mwa6zYxON2/xhgRfzUJnB7Loc0qyN4vCmATRIyK3CmUhKSIZLWR4BhJdetC0bK+nBN3fGKuX3ZTcxBsVIWQwt1Xi6NU9IBJS2PAWK8TW94jEIBxrwKxd+KPjrFY7OlcS30P2594HObwlSijewZbB/IA+qoQnNq8IbnZZsJqEtxxXTv3BGYf5WxWRmJVKSmxbz+MK994N9/ipTpvws6ddOXb31cKokQ7NYCi8mM30u683wqRbDVwqP6WACXWgQjxFFHhLK7BD+Xpf2ryv6qu9w0zSUMMHqUbw5Xymp4KB2Rh/1kycHLyA2/33LisJ+i6JbpQiupx15w4XJZI2YO/5zcqbbcNgHR2ROQ9xRWjRBDI2iYYsADfcPM+hboYbyu1QAohywBRW3CePzyDJIiWP60bMm3+g/FwzNwQwuH8gJsHTRtNj5OqkcXvqzzKnOzTTIcu9Y2TDg54jJbxAhuv+AVq93fMXM00YvEQXFj1WKpYz/ODOay+UNs3WA7+d7TuKviG4mqwdvrTiz3MsjkZfGi5sTx1vZ+yt5x4M1Kse5SE59edOkFZpQuDyAN4RsRMMiTH9ntDwmxb0BvJ63ZDIFyJE9yB/ebPyHdZKE7Q7kVOaUOTt3nndlebO5hxqo7UigzfXwWdS10FlQtSVKjMXMuW4W1xzI98iIVvh9/ly71TaJyQ/T9udJKl03m6rDM5Mt37o9m5UJvUnBHSL6glj6ga+Ve0k+9eWl7fnsbK/8qZ+GLYB0jxnzMqEpmsOiH+s1KhMOX22H+eSk073j4FH5TK1KjvIolqnZt4jXK8oBqa6/BQ9U0pwt5ginAzen1tQXg2UHIUpYdB+DgIXlIVPDLfPiAfuig1mhky1nyv/eMr3kGJrNL3zDkLn7fbZ67k5R0Bc8wspZ55JSCrANOujzWkjsu9zZEx85KBe5w/3kCNR90IMRR36PDrWCP6zMqVOI/P4gI/GQZI8JvzbwM+Il5+bhjXI2hVMRYbCl3Z8MZXC9H/RpPl+ZbmDqgtcOD2gGpBYxTOvviA7KbDhIenznX74g/ippT8WiDJzfXcaogbCb1SG0E9tdYWUBD1mNFXLhccKAWuwQaSScJYh7ijNYDeDkT9wd0kTk+zXC5PJ/NO3b4CQdsJPl25By4aXPlRx61BZRR8XV5yGkdCYoxjtATjk6lKFErFZ8x0y3kOcyy6hCDdMPv6sMVi8/NJLGxup1Bpb5XQeXLfmTT1PzCPmvBzcgBug2z94TeAw1T9mriBbSmTCtD74IjJSQB40y/76a1XWndJU18GrPyKR01wpuecBIL2Dz2v9y
  • 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>

Hi Mark,

Thanks for this correction, but we have tested the program with valid and
non valid addresses.

The result give use each time the same return.

So there is something else wrong in using this regexec function.

BR
Danny

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

Looking at the documentation for regexec() I find:


Return Value

If *a match is found*, the regexec() function returns 0. If no match
is
found, the regexec() function returns REG_NOMATCH. Otherwise, it returns a
nonzero value indicating an error.
A nonzero return value can be used in a call to the regerror() function.


So, it appears that you may be setting PxOK backwards (depending on what the
values 0 and 1 mean to you). If 0 is not OK, and 1 is OK, then:

if rc = 0;
PxOK = 1;
else;
PxOK = 0;
EndIf;



On Tue, Dec 5, 2017 at 9:39 AM, David Gibbs <david@xxxxxxxxxxxx> wrote:

On 12/5/2017 8:09 AM, Danny Rodius wrote:

Have checked these scalar functions out. However a compare is not
included. Need to check if an email is valid.


Can you give an example of the expression & data and results you would
like?

I found the REGEXP_INSTR function will tell me if a character field
matches the expression

Here's a really basic example I've used in the past ...

values(regexp_instr(
'david@xxxxxxxxxxxx',
'[A-Z0-9._%-]+@[A-Z0-9._%-]+\.[A-Z]{2,4}',
1,
1,
0,
'i'));

The returned value is 1.


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.n et/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

--
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.