Re: more damn non-standard email systems, using "-Reply"1997-08-20 17:16:38Hi Tim. Instead of this NEWSUB=`echo "$SUBJECT" | sed 's/\-Reply$//g'` and the subsequent recursion etc., try this one: NEWSUB=`echo "$SUBJECT" | perl -p -e 's/^((Re:\s*)*)?(.*)/Re: \3/i; s/(\s*-reply)*$//i'` which will 1) produce exactly one leading "Re: ", no matter how many exist initially (including zero), ignoring their case. 2) zap all trailing instances of -reply (ignoring case), each optionally preceded by whitespace. Terry.
|
|