You are correct that I am talking about recompiling only the expression. It
is done with "regcomp".
I don't remember ever having this performance issue before. Does anyone
know if there is an issue in 7.3 that may be fixed by a PTF or something
that we have not yet installed?
-----Original Message-----
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of John Yeung
Sent: Tuesday, June 4, 2019 12:14 PM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Need help with a regex pattern
On Tue, Jun 4, 2019 at 11:54 AM <smith5646midrange@xxxxxxxxx> wrote:
It would be a ton more than 3 because I also want [punctuation/syntax]
Though it's ugly and ridiculously verbose, it may well be faster than the
"pure" regex approach in SQL.
As for having a variable search pattern:
Is there a way to build an expression so I can provide a variable
value at run time rather than freeing and recompiling the pattern
every time the variable changes?
By "recompiling the pattern" you don't mean recompiling the whole program,
do you? You really mean *just* the pattern, right? (I'm trying to clarify
because I don't really use ILE or APIs very much, and the phrase "recompile
the regex pattern" usually refers to something that does occur during *run*
time.)
Assuming my understanding of compiled regex patterns is correct, I think the
answer is no. I don't think a pattern can have a variable portion. Even so,
I don't think the overhead of recompiling a regex pattern is that expensive
compared to the apparent cost of doing it in SQL (unless Birgitta can swoop
in with a better way that nobody else thought of).
John Y.
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post a
message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit:
https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.