|
I am not going to provide performance comparisons, Dennis. These and
other
measures would be part of on-site acceptance-testing and as such would
provide figures more relevant than any I might generate.
Regards,
Joihn McKay mba
----- Original Message -----
From: "Dennis Lovelady" <iseries@xxxxxxxxxxxx>
To: "'RPG programming on the IBM i / System i'" <rpg400-l@xxxxxxxxxxxx>
Sent: Friday, August 13, 2010 2:10 PM
Subject: RE: Regular Expressions
Thank you for your responses, John. While I don't see the benefit ofdifficult
using
one individual's API under the conception that another's API is
toin
learn/use, I salute you making this available. I am not some other
person,
and this may exactly fit that other person's needs!
But I did notice that you avoided the performance question. I'm just
saying. :)
Dennis Lovelady
http://www.linkedin.com/in/dennislovelady
--
"For a moment, nothing happened. Then, after a second or so, nothing
continued to happen."
-- The Hitchhiker's Guide to the Galaxy
I had three objectives for producing this implementation.
The first objective was to use a single call instead of REGCOMP,
REGEXEC
and REGFREE.. This is closer to the "standard" implementation found
causedother
languages and scripts. It also makes regular expressions more
accessible to
those who are unfamiliar with the IBM api's.
My second objective was to remove the confusion / ambiguity
myby
differing character sets / ccsid's. While I cannot guarantee that
/implementation will work successfully across all the character sets
thisccsid's, it is more robust than the IBM-supplied api's.
My third objective was to widen the range of regular expressions
available here. Allied to this was the need to improve the
documentation
for RPG developers.
Two of the examples illustrate a return position rather than 1
(alpha, h
and alp25a, \d, both of which return position 4).
Messages which can be of help in determining whether a regular
expression is valid or not can be obtained from the return code. A
negative
return code (range -1 to -18) will indicate the message based on the
IBM
documentation. These return codes are in the readme, which can be
viewed on
line.
I agree with you in that "the hard part is in coming up with the
right
expression". This is the case in all implementations of regular
expressions. Different implementations use different (albeit very
similar)
syntaxes and there is a set of standard escape characters and
punctuation
characters.
I had considered an implementation of REGEXEC on its own, but
l@xxxxxxxxxxxx>cannot be done without a related implementation of REGCOMP. If you
think
this to be useful, I will look at it again.
Regards,
John McKay mba
----- Original Message -----
From: "Dennis Lovelady" <iseries@xxxxxxxxxxxx>
To: "'RPG programming on the IBM i / System i'" <rpg400-
ISent: Friday, August 13, 2010 10:03 AM
Subject: RE: Regular Expressions
Thanks, John. I've seen implementations like this before (but notpublic
domain). I cannot download and restore a save file to the systems
havingaccess,
so there is conjecture here. That conjecture can be solved by
eacha
FAQREGFREE
for the product. I presume that you're doing REGCOMP, REGEXP,
withthe
each operation. Have you measured the performance of this against
alternative (REGCOMP at the beginning of a process, REGEXP for
of x
million rows/columns/whatevers, REGFREE at the end?
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.