Gentoo Archives: gentoo-user

From: Michael Sullivan <michael@××××××××××××.com>
To: gentoo-user <gentoo-user@l.g.o>
Subject: [gentoo-user] OT - Extracting IP addresses with grep
Date: Thu, 12 Oct 2006 19:18:09
Message-Id: 1160679065.12681.10.camel@camille.gateway.2wire.net
1 I have a mail directory with several hundred spammish emails that have
2 been collecting over the past month. I haven't gotten around to
3 processing them yet (abuse@×××.net if available, blocked if not) I
4 would like to write a script that would extract the IP addresses from
5 all these emails, but I can't figure out how to get grep to cooperate.
6 I created a perl regular expression for matching against IP addresses
7 and tried to pass it to grep, but it wouldn't return anything. I don't
8 know what I'm doing wrong. Here's my command:
9
10 michael@bullet ~/.maildir/.SPAM/cur $ cat * | grep -P m/\d+\.\d+\.\d
11 +\.\d+/
12
13 --
14 gentoo-user@g.o mailing list

Replies

Subject Author
Re: [gentoo-user] OT - Extracting IP addresses with grep Willie Wong <wwong@×××××××××.edu>