On Sun, 09 Jan 2005, 00:25 GMT+01 Dallman Ross wrote:
[...]
I don't see any need to save the right-hand part. What for?
The intention of my 'av_split.inc' is to split a string
($av_SPLIT_STRING) into two pieces ($av_SPLIT_LEFT and
$av_SPLIT_RIGHT) at a given position ($av_N):
av_SPLIT_STRING = 'aaaBBBB'
^
|____> we want to split it at position av_N = '3'
into the left and right piece, giving
'aaa'
and 'BBBB'
Your recipe does only result in the left part, but not in the right
one.
If you have a look into 'av_split.inc', you will see that my solution
is done using simple code:
MATCH
:0
* av_SPLIT_STRING ?? ^^\/.
{
av_SPLIT_LEFT = "$av_SPLIT_LEFT$MATCH"
}
MATCH
:0
* av_SPLIT_STRING ?? ^^.\/.*
{
av_SPLIT_STRING = $MATCH
}
:0
* $ $av_N ^0
* -1 ^0
{
av_N = $=
INCLUDERC = $_
}
:0 E
{
av_SPLIT_RIGHT = $av_SPLIT_STRING
av_SPLIT_STRING
}
# We currently always break the string from left to right. If the right part
# is shorter than the left one, parsing from the other direction would be
# faster. For the time being, however, I don't care.
rob.
____________________________________________________________
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