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



Be careful with "regcomp", it does not support PCRE as does SQL regular
expressions. The best I can determine, it only supports the GNU syntax
which is only a small subset of PCRE. SQL uses International components for
unicode to support regular expressions, and you can use those as well from
RPG, it is just a lot more work trying to figure out how to use it. The
documentation for ICU is not in the IBM Knowledge Center, but instead is on
the ICU website ( http://site.icu-project.org/ ). And that documentation is
not IBM i specific, but should be clear enough on how to use it from C or
C++.

On Tue, Jun 4, 2019 at 12:26 PM <smith5646midrange@xxxxxxxxx> wrote:

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

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

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.