procmail
[Top] [All Lists]

Re: equivalent for backreference \1

2002-08-03 08:47:32
On  3 Aug, Hanspeter Roth wrote:
|   On Aug 03 at 10:32, Don Hammond spoke:
| 
| > Not exactly, but it can be done using the contents of $MATCH as assigned
| > by the MATCH token "\/".
| > 
| > # thisrc
| > DEFAULT = /dev/null
| > NL="
| > "
| > VAR = ${VAR:-666}
| > :0
| > *   VAR ?? ()\/[0-9]
| > * $ VAR ?? ()\/$MATCH$MATCH$MATCH
| > { LOG = "Matched $MATCH$NL" }
| 
| Ok. I should be more precise. I want something like:
| 
| * ^Subject: .*([-!-,:-(_at_)])\1\1.*$
| 
| \/ would probably match the whole reminder of the line.
| 
| Or should I use something like:
| 
| :0 fhw
|| grep '^Subject: .*([-!-,:-(_at_)])\1\1' >/dev/null
| 
| :0 a
| ...
| 

I assume you would need egrep or grep -E. The redirection of stdout is
unnecessary. Procmail will ignore it (although stderr gets written to
LOGFILE).

But I think you can still get it done without forking grep, unless I'm
not understanding something.

*   ^Subject:.*\/[-!-,:-(_at_)]
* $ ^Subject:.*$MATCH$MATCH$MATCH

Unfortunately I'm headed out of town for the weekend. If that doesn't do
it, someone else will have to pick up on this.

-- 
Reply to list please, or append "8" to "procmail" in address if you must.
Spammers' unrelenting address harvesting forces me to this...reluctantly.


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail