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



Thanks to you and Mr Klement for the feedback. I will try Mr Klements
suggested pattern. Also good to know it needs to be POSIX compliant.
That's helpful.

Thanks again.

Terry Bullard

On Feb 13, 2014, at 4:30 PM, "Thomas Garvey" <tgarvey@xxxxxxxxxx> wrote:

IBM doesn't support all extensions for Regular Expressions. I have also
been caught in that testing against web RE testers. You have to make
sure you select one that is only using POSIX.

If you stay within POSIX standards, you should be OK on the IBM i. That
backwards slash doesn't look familiar.


Pressing on,

Thomas Garvey



On 2/13/2014 3:03 PM, terry_bullard@xxxxxxxxxxxx wrote:
Trying to use regular expressions in RPGLE.

Have the following:
string = 'Some stuff A410920 other stuff' + x'00';
in@pattern = '[AaZz]{1}[Aa0-9]{1}\d{5,6}' + x'00';
preg = %addr(regex_t);
pmatch = %addr(regmatch_t);

// Compile RE
rc=regcomp(preg:%addr(in@Pattern):REG_EXTENDED);

// Execute RE
rc = regexec(preg: %addr(string):
nmatch: pmatch: 0);


I am trying to match/find A410920 in the string.

In this case - it does not find a match: If I put this same example in
one of the web based regular expression testers - It matches fine.

If I change the in@pattern to '[AaZz]{1}[Aa0-9]{1}' + x'00';
it will match the A4 portion of the string.

Can't seem to figure out what is wrong. Any help would be appreciated.

Thanks


Terry L. Bullard
Application Development Consultant
The Goodyear Tire & Rubber Company
6650 Ramsey Street, Fayetteville, NC 28311
phone.910.630.5644
terry_bullard@xxxxxxxxxxxx





--
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: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



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.