From ino-waiting@gmx.net  Wed May 17 11:16:08 2000
Received: from mout1.freenet.de (mout1.freenet.de [194.97.50.132])
	by swi.psy.uva.nl (8.9.3/8.9.3) with ESMTP id LAA01652
	for <prolog@swi.psy.uva.nl>; Wed, 17 May 2000 11:16:08 +0200 (MET DST)
Received: from [194.97.50.135] (helo=mx2.freenet.de)
	by mout1.freenet.de with esmtp (Exim 3.14 #3)
	id 12rzwH-0007zi-00
	for prolog@swi.psy.uva.nl; Wed, 17 May 2000 11:16:25 +0200
Received: from [213.6.1.108] (helo=spotteswoode.de)
	by mx2.freenet.de with smtp (Exim 3.14 #3)
	id 12rzwF-0001R2-00
	for prolog@swi.psy.uva.nl; Wed, 17 May 2000 11:16:24 +0200
Received: (qmail 826 invoked by uid 0); 17 May 2000 09:15:32 -0000
From: "clemensF" <ino-waiting@gmx.net>
Date: Wed, 17 May 2000 11:15:31 +0200
To: SWI Prolog <prolog@swi.psy.uva.nl>
Subject: string-extract in prolog?
Message-ID: <20000517111531.A297@spotteswoode.de>
Mail-Followup-To: SWI Prolog <prolog@swi.psy.uva.nl>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Mailer: Mutt 1.0.1i
Organization: private

i wonder.  given any text occuring in the context of rfc822 email, can a
simple, efficient filter application be written in prolog, which will
extract rfc822 addresses (user@host.do.main) from stdin, discard everything
else and output the address on stdout?

example:  if cat my/.signature | rfc822address; then
                cat > address
          fi

i haven't tried it myself, because i think (prejudice?) it would be a waste
of resources.  one would have to make a script, i suppose, starting with:
"#!/local/bin/pl -f none -x rfc822adr.qs -g adr."  ok, taken into account
that prolog is not the easy scripter, one can always rely on the fact that
any future developments can be handled by prolog, so the task is not so far
fetched.  tomorrow i might need my little prolog to recognize an
addressbook or check if a realistic real name belongs to the given address.


-- 
clemens                                              ino-waiting@gmx.net
        do                                              D4685B884894C483
        gpg recv-key 0x9
        echo `gpg list-key 0x9 | cat -tv` | \
        gpg encrypt `gpg list-key 0x9 | 822address` | \
        mail -s your-key `gpg list-key 0x9 | 822address`

