|
That is just riduculous to say you should stay away from REGEX on the iSeries. I use it at least a few times a week in my programs, and I have no problems with it. You just need to understand what you are doing.
One thing about REGEX is that most systems/Languages have there own implementation, some good some bad. At least IBM tried to follow the POSIX standard when they implemented REGEX. Granted there are some better flavors out there, at least they did not make up a new one.
*-------------
Aaron,
If I were to convert you REGEX to run on the iSeries, I came up with:
([[:graph:]][[:graph:]]{40,}|.{1,40})([[:space:]]+|$)
Be sure to compile it as Extended.
Chris Beck
Paul.Nicolay@xxxxxxxxxx 9/21/2008 1:09:02 PM >>>
Scott,
I also found this out some time ago (see other postings regarding
regex), and it should encourage everyone to stay away from it on
iSeries. Regex is only a valuable function if it would be available in
its most complete form (also see what other systems offer regarding the
"greedy" concept).
Hence for trivial things as splitting a line, one can better write its
own procedure.
Kind regards,
Paul
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Scott Klement
Sent: vrijdag 19 september 2008 16:01
To: RPG programming on the AS400 / iSeries
Subject: Re: regexec - chopping a large text string into chunks
Perhaps IBM's biggest crime in this situation is it's HORRIBLE
documentation. The docs say NOTHING about what is and is not supported
in their regcomp() API. The only thing I can find in the docs is this:
"The functions regcomp(), regerror(), regexec(), and regfree() use
regular expressions in a similar way to the UNIX(r) awk, ed, grep, and
egrep commands."
--
This is the RPG programming on the AS400 / iSeries (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.
This email transmission and any documents, files or previous
email messages attached to it may contain information that is
confidential or legally privileged. If you are not the intended
recipient, you are hereby notified that any disclosure, copying,
printing, distributing or use of this transmission is strictly
prohibited. If you have received this transmission in error,
please immediately notify the sender by telephone or return
email and delete the original transmission and its attachments
without reading or saving in any manner.
The Evangelical Lutheran Good Samaritan Society.
--
This is the RPG programming on the AS400 / iSeries (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.