Re: problem using regular expressions

2005-05-03 Thread Offer Kaye
On 5/3/05, Ing. Branislav Gerzo wrote: > > CD>my $address = '[EMAIL PROTECTED]'; > CD>my ( $domain = $address ) =~ m/@(.*)/; > > uff, I think you write this in hurry, this simply won't work. For completeness, you really should write what *will* work. Here's a correct version: my $add

Re: problem using regular expressions

2005-05-03 Thread Ing. Branislav Gerzo
Chris Devers [CD], on Tuesday, May 3, 2005 at 10:58 (-0400 (EDT)) thoughtfully wrote the following: >> I use BayesIt in The Bat, works well. CD> Is it written in Perl ? I don't think so :) CD> Part of the reason I suggested SpamAssassin -- aside from it being an CD> effective tool in its own rig

Re: problem using regular expressions

2005-05-03 Thread Chris Devers
On Tue, 3 May 2005, Ing. Branislav Gerzo wrote: > Chris Devers [CD], on Tuesday, May 3, 2005 at 10:16 (-0400 (EDT)) > typed: > > CD>my $address = '[EMAIL PROTECTED]'; > CD>my ( $domain = $address ) =~ m/@(.*)/; > > uff, I think you write this in hurry, this simply won't work. Sorry, ye

Re: problem using regular expressions

2005-05-03 Thread Ing. Branislav Gerzo
Chris Devers [CD], on Tuesday, May 3, 2005 at 10:16 (-0400 (EDT)) typed: CD>my $address = '[EMAIL PROTECTED]'; CD>my ( $domain = $address ) =~ m/@(.*)/; uff, I think you write this in hurry, this simply won't work. You have already declared $address so it will make exception, and also wi

Re: problem using regular expressions

2005-05-03 Thread Chris Devers
On Tue, 3 May 2005, gavin mc auley wrote: > I am new to perl and regular expressions. I am trying to write a > simple spam filter. There's your first mistake! :-) This is a slippery slope. Your simple filter isn't going to be as effective as you want, so you'll want to tweak it. The second d

Re: problem using regular expressions

2005-05-03 Thread Ing. Branislav Gerzo
gavin mc auley [gma], on Tuesday, May 03, 2005 at 15:03 (+0100) has on mind: gma> is [EMAIL PROTECTED], I want to extract hotmail.com. This is here is 2 ways how to do that: (my $domain = '[EMAIL PROTECTED]') =~ s/[EMAIL PROTECTED]@//; or my $domain = $1 if '[EMAIL PROTECTED]' =~ /@(.*)/; there

problem using regular expressions

2005-05-03 Thread gavin mc auley
I am new to perl and regular expressions. I am trying to write a simple spam filter. for part of this program I want to extract all characters after the @ character. i.e. if the email is [EMAIL PROTECTED], I want to extract hotmail.com. This is probably a simple task but I am having a problem ac