procmail
[Top] [All Lists]

extracting all but three characters

1996-08-24 14:06:35
Is there a way extract all but the last three characters of a string (with
the MATCH facility, that is; I know how to do it by forking cut or sed or
expr or ksh) into $MATCH if any character can occur at any position?

For example, if we know that the last character to extract is a digit and
the remaining three are not digits, this works:

   :0 # extract though last digit
   * BIGSTRING ?? ^^\/.*[0-9]
   { SAVEDPIECE="$MATCH" }

But what if we don't have any such particulars to rely on?

DWT

<Prev in Thread] Current Thread [Next in Thread>