Gossamer Forum
Home : General : Perl Programming :

how to remove quoted message

Quote Reply
how to remove quoted message
   


when parse mail body, how to remove quoted message




For example



this is the mail message line one
>this is the mail message line two
>this is the mail message line three






how to remove line two and line three?
shoud i have to using special tag in mail.
so when someone reply the mail. quoted message will
be wrapped in special tag. much like move javascript?

or any more easy clever way to move line two or three.

Thanks in advance
Quote Reply
Re: [courierb] how to remove quoted message In reply to
Not quite sure what you mean... but you could use something like this;

Code:
my $slurp = q|For example



this is the mail message line one
>this is the mail message line two
>this is the mail message line three

|;

my @sliced = split /\n/, $slurp;

my $return;
foreach my $line (@sliced) {
if ($line =~ /^\>/) {
next;
} else {
$return .= $line . "\n";
}
}

# $return should now hold the email, minus lines that start with >

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] how to remove quoted message In reply to
Thanks Andy. you are right.

what i mean in early mail is preformat mail to the recipeint by adding tag in the mail body

when some one reply, I will get message with tag






real message line one

<taghere>
quoted message line two
quoted message line three
</taghere>








so using code below to remove line two and three or anything between tag

$body =~ s<taghere[^>]*>.*?</taghere[^>]*>





Thanks
Quote Reply
Re: [courierb] how to remove quoted message In reply to
Ah, in that case even this should work;

$cost ~ /\<taghere\>(.+?)\<\/taghere\>/ and $outcut = $1;

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] how to remove quoted message In reply to
Thanks again. i have already take your first section of code.



by the way. i wonder if you have demo of your plugin Thumb_Images?



Thanks
Quote Reply
Re: [courierb] how to remove quoted message In reply to
Cool :)

Quote:
by the way. i wonder if you have demo of your plugin Thumb_Images?

I'm afraid not. When pugdog and myself finally start the new joint venture (UltraNerds), I'll be putting demos up of all the plugins.

If you would like to try the plugin, then please PM me, and I'll send a copy over for you to test :)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!