procmail
[Top] [All Lists]

Re: Getting partial matches from a string without forking an outside process

2005-01-08 15:44:22
Toen wij Robert Allerstorfer kietelden, kwam er dit uit:
Ruud H.G. van Tol:

[Jari mentioned something]
That remark is about strings like "xxxxxx6xxx6xxx6xxxx".

I haven't tested your recipe as well, but my solution will also work
on this string

Right, but if you look into (for example) snr.inc (that you include in 
your code) then you will find the split-technique there.


Something else:

You have replaced rep.inc with your av_cat.inc inside av_snr.inc, which
is OK since they basically do the same (repeat a string a number of
times).

For higher numbers it really pays off to use rep_fast.inc, because
it needs far less recursions. This can be tested wit rep_fast_demo.rc
See http://www.xs4all.nl/~rvtol/procmail/ --> archive --> 121.zip

Some results (in repeats:iterations) 10:3, 100:7, 1000:13,
so only double the number of iterations for ten times the number of
repeats.


You use snr.inc to replace '_' by ' ', where xlt.inc is more efficient
for single-character-translations, but I guess that you already know 
that.

-- 
Grtz, Ruud


____________________________________________________________
procmail mailing list   Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail