Hi all
I'm newbie in perl and stacked with one regular exression. Im writing some mail parser and want to find mail id.
The header example:
From root@test.com Wed Nov 14 12:35:06 2007
Return-Path: <root@test.com>
X-Original-To: test
Delivered-To: test@test.com
Received: by test.com (Postfix, from userid 0)
id 25CFB1A406C; Wed, 14 Nov 2007 12:35:06
To: test@test.com
Subject: sdsd
Message-Id: <20071114093506.25CFB1A406C@test.com>
Date: Wed, 14 Nov 2007 12:35:06 From: root@test.com (root)
I must extract 25CFB1A406C string.
I can do it with this regexp:
/.*\sid\s(([A-Z]|[0-9]){11}).*/
But as I understood it is simple and can handle unwanted strings.
When I tried to make it more narrow like:
/.*Received:.*\sid\s(([A-Z]|[0-9]){11}).*/
I cant extract mail ID. Can you help me with writing regexp?
Thanks in advance.
I'm newbie in perl and stacked with one regular exression. Im writing some mail parser and want to find mail id.
The header example:
From root@test.com Wed Nov 14 12:35:06 2007
Return-Path: <root@test.com>
X-Original-To: test
Delivered-To: test@test.com
Received: by test.com (Postfix, from userid 0)
id 25CFB1A406C; Wed, 14 Nov 2007 12:35:06
To: test@test.com
Subject: sdsd
Message-Id: <20071114093506.25CFB1A406C@test.com>
Date: Wed, 14 Nov 2007 12:35:06 From: root@test.com (root)
I must extract 25CFB1A406C string.
I can do it with this regexp:
/.*\sid\s(([A-Z]|[0-9]){11}).*/
But as I understood it is simple and can handle unwanted strings.
When I tried to make it more narrow like:
/.*Received:.*\sid\s(([A-Z]|[0-9]){11}).*/
I cant extract mail ID. Can you help me with writing regexp?
Thanks in advance.