|
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-
bounces@xxxxxxxxxxxx] On Behalf Of Charles Wilt
Sent: Friday, August 13, 2010 8:54 AM
To: RPG programming on the IBM i / System i
Subject: Re: Regular Expressions
Dennis,
It would seem to me that your concerns could be simply addressed by
keeping track of the last expression REGCOMP'd and not doing the
REGFREE until the expression changes or the activation group ends.
In fact, if it we're me, I'd consider keeping a lookup table of
expressions and either the DS or pointers to dynamically allocated DSs
that REGCOMP uses.
That way you could have more than one regex "active" as it were.
Charles
On Fri, Aug 13, 2010 at 5:03 AM, Dennis Lovelady <iseries@xxxxxxxxxxxx>
wrote:
Thanks, John. I've seen implementations like this before (but notpublic
domain). I cannot download and restore a save file to the systems Iaccess,
so there is conjecture here. That conjecture can be solved by havinga FAQ
for the product. I presume that you're doing REGCOMP, REGEXP,REGFREE with
each operation. Have you measured the performance of this againstthe
alternative (REGCOMP at the beginning of a process, REGEXP for eachof x
million rows/columns/whatevers, REGFREE at the end?one
My studies on this (which I unfortunately cannot share) suggest that
would be much better off using REGCOMP and REGFREE themselves, ratherthan
taking such a generic approach. After all, the hard part isn't incalling
those expressions or evaluating their results; the hard part is incoming up
with the right expression, and that remains a hurdle with yourapproach.
performance?
In other words, what is the value-add that may be traded for
return a
Your examples, when they find a match, find them in position 1, and
1. What happens if a match is found in position n?(optional or
When one makes a mistake with a regular expression, what help
otherwise) does the function return?remove
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"Better to remain silent and be thought a fool than to speak out and
all doubt."free
-- Abraham Lincoln
Single function regular expressions - regexp - now available for
mailingat www.rpglanguage.com/regexp
Regards,
John McKay mba
--
This is the RPG programming on the IBM i / System i (RPG400-L)
mailing listlist
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.
--
This is the RPG programming on the IBM i / System i (RPG400-L)
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.
This is the RPG programming on the IBM i / System i (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 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.