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



> Is there a way to access/verify fields against regular expressions in RPG?
> Has anyone done this before, using regular expressions??

I wrote some sample code that demonstrates regular expressions in RPG.
You can download it here:
http://www.iseriesnetwork.com/noderesources/code/clubtechcode/RegularExp.zip


I updated one member of that sample code to use iconv() to ensure that the
regex was in a CCSID that the API understood (users in other countries had
problems).  The updated copy of that member can be found here:
http://www.scottklement.com/qrpglesrc.redemo2


> For instance, I may want to verify a website syntax, or a credit card
> syntax, etc.

However:

  a) There's no requirement that web sites have to start with 'www',
       that's just a convention.  I would never use that regex.

  b) Credit cards are better checked with a mod10 self-check.

  c) For e-mail addresses I wrote a program that parses them and
         checks the domain via DNS that will work a little better
         than a simple regex can.

E-mail address verify service program:

http://www.iseriesnetwork.com/noderesources/code/clubtechcode/ValidateEmail.zip



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.