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



Hey Dennis,

I have absolutely no experience using the regex stuff, but the syntax of the call in your code example includes "match(1)" as the 3rd parameter. This doesn't restrict the number of find instances (1) does it?

rc = regexec(regEx
: findWithin
: %Elem(match)
: match(1)
: *Zero

I couldn't quickly find any documentation that seemed to apply. Just stabbing into the darkness.

Steve Needles
Northland Insurance
(651) 310-4203


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Dennis Lovelady
Sent: Wednesday, February 03, 2010 10:12 AM
To: 'RPG programming on the IBM i / System i'
Subject: Regular Expression multi-match not as expected

Folks, I'm getting unexpected result from Regular Expression matching on
System i at V5R3. You can see the code in question at
http://code.midrange.com/e15d4eb99d.html.



I expect the expression to match on both the word "one" and the second
position of the word "none" but the search seems to stop after the first
match. (I can see that it has initialized all elements of match, however,
for whatever that's worth.) To see the issue, run in debug mode and set a
breakpoint at the line that contains "Match(es)". At that point, rc should
be zero (and it is); the first element of match should point to the second
character of done. (all good so far). But the second element of match
should point to the word "one" and it doesn't.



Can you see what might be wrong with this? Thanks.



Dennis E. Lovelady
AIM: delovelady MSN: fastcounter@xxxxxxxxxxxx
<http://www.linkedin.com/in/dennislovelady>
www.linkedin.com/in/dennislovelady --
"Nothing makes you more tolerant of a neighbor's noisy party than being
there."
- Franklin P. Jones




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.