En Thu, 14 Aug 2008 12:50:57 -0300, Ahmed, Shakir <[EMAIL PROTECTED]> escribió:

> I need to grab/parse numeric numbers such as app number from incoming
> emails stored in Microsoft Outlook (Microsoft Exchange server) with
> specified subject line.
>
> The email body is like this
>
> myregion ; tst ; 11-Aug-2008
>
> http://my.xyz.com/dddd/content/ifs/apps/myDocFolder/NoticeOfapplication/080612-21_test_337683.pdf
>
> I need to extract 080612-21_ number from above line from incoming
> emails.

I can't help with the part dealing with Outlook - but once you retrieved the 
email body, it's easy:

import re
re_number = re.compile(r"NoticeOfapplication/([0-9-_]+)")
match = re_number.search(body)
if match:
  print match.group(1)

(this matches any numbers plus "-" and "_" after the words NoticeOfapplication 
written exactly that way)

-- 
Gabriel Genellina

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to