procmail
[Top] [All Lists]

Re: $MATCH expiration day/time

1997-07-05 13:05:00
thsk(_at_)netcom(_dot_)com asked,

| It is the DDHHMM that I'm looking to $MATCH.  Here are some
| examples:
| 
| MAZ501-504-161415-
| MAZ002>004-NHZ011-012-022100-
| MAC027-017-122315-
| MAC009-131915-
| MAZ501-502-501-221945-
| MAZ504-222145-
| RIC003-009-222145-
| MAZ501-502-503-RIZ501-502-222300-
| RIC005-222215-
| MAZ007-014-015-MAZ501-502-252230-
| CTC003-261745-
| MAZ503-RIZ501-502-501-262100-
| 
| My QUESTION is...  How to $MATCH just the DDHHMM without the
| leading or trailing dash (-) at the end of the line?

Era Eriksson has shown how to use two extractions (one to get the last field
and one to strip the closing hyphen):
    
    * ^Expires:.*\/[^-]+-$
    * MATCH ?? ^^\/[^-]+
    
but you may not need to go that far.  It seems that nowhere else in the
string is there ever a sequence of six adjacent digits.  Thus,

 * ^Expires:.*\/[0-3][0-9][0-2][0-9][0-5][0-9]

should do the trick.

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