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



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






As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.