473,472 Members | 2,148 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

rfc822 regexp

Hi.

I have a problem with writing regular expression :-( There is message's header:

From: blah-blah
To: blah-blah <blah@blah>, blah1 <blah1@blah>,\n\t blah2 <blah2@blah>
Cc: blah3@blah
Subject: rfc822 regexp

and so on. Also, I have some string, which exactly matches part of field
"To:" for example 'blah1 <blah1@blah>'. I need to remove this substring
from field, noting that field can be multiline.

I've spent lots of time and didn't succeed. All I have, doesn't give a
correct result for all combination of commas, spaces, tabs and newlines in
the field.

Am I inventing wheel? Any ideas?

Thank you.

--
Man is incomplete until he is married. Then he is finished.
Jul 19 '05 #1
1 2600
Vladimir Litovka <do**@kiev.sovam.com> wrote in message news:<bv**********@news.kiev.sovam.com>...
Hi.

I have a problem with writing regular expression :-( There is message's header:

From: blah-blah
To: blah-blah <blah@blah>, blah1 <blah1@blah>,\n\t blah2 <blah2@blah>
Cc: blah3@blah
Subject: rfc822 regexp

and so on. Also, I have some string, which exactly matches part of field
"To:" for example 'blah1 <blah1@blah>'. I need to remove this substring
from field, noting that field can be multiline.

I've spent lots of time and didn't succeed. All I have, doesn't give a
correct result for all combination of commas, spaces, tabs and newlines in
the field.

Am I inventing wheel?
Yes.
Any ideas?
Get a wheel off the shelf from CPAN.
Thank you.


This newsgroup does not exist (see FAQ). Please do not start threads here.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Michael B Allen | last post by:
How can I zoom in on what's going on below? $ archivemail -n ~/Maildir/.Lists.* /home/miallen/Maildir/.Lists.CIFS: I would have archived 11 of 29 message(s) in 0.1 seconds...
5
by: Lukas Holcik | last post by:
Hi everyone! How can I simply search text for regexps (lets say <a href="(.*?)">(.*?)</a>) and save all URLs(1) and link contents(2) in a dictionary { name : URL}? In a single pass if it could....
1
by: John Doe | last post by:
I've never used a factory and would like to get some help. The class mailbox.UnixMailbox has a defination for a factory. __init__(self, fp, factory=<class rfc822.Message>) where fp is a file...
5
by: John Smith | last post by:
Hi, I've been carefully storing my dates as ISO dates in a DB and now have to add an RSS feed to a website. Is there an easy way to convert these dates to RFC822 compliant dates ? I've had a...
4
by: Nemesis | last post by:
Hi all, I found that the function parsedate_tz of the rfc822 module has a bug (or at least I think so). I found a usenet article (message-id: <2714d.q75200@myg.winews.net>) that has this Date...
1
by: praba kar | last post by:
Dear All, I am new to python world. I have pasted my code which I used it to build rfc822 format mails for webbased mailing system task(which is like to yahoo.com web interface). Now I am...
4
by: Jon Maz | last post by:
Hi All, I want to strip the accents off characters in a string so that, for example, the (Spanish) word "práctico" comes out as "practico" - but ignoring case, so that "PRÁCTICO" comes out as...
0
by: Nikolaus Schulz | last post by:
Hi, while playing with the rfc822 module and imaplib, I've found the following weird behaviour. Quickstart: rfc822.Message(fp) instantiates a rfc822.Message object from a file object fp. The...
3
by: Phoe6 | last post by:
Hi all, Have a look at this snippet, I have a file direct.txt and I want to read it as rfc8222.Message() so that I get the Subject: and Mood: as Dict Keys and content separately, but I am unable...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.