Perl Regex HELP!

Duston, Hal hdusto01 at sprintspectrum.com
Fri Jul 26 19:44:35 CDT 2002


Jason Baker [mailto:baker at cyborgworkshop.com] wrote:
> 
> I am going nuts here!   Im trying to do, what I would think 
> would be, a simple regex on a string.  I have a string that 
> looks like this
> 
> To: user at where.com, user2 at where.com
>     user3 at where.com
> Cc: user4.here.com
> 
> 
> What I want to do is pickup all of the email addys on the To: 
> like, spanning both lines, and put them into a string. The only 
> consistent string terminator is to match a line that begins with 
> a character and has a colon.  I can't get the regex to work to 
> save my own life though.
> 
> m/(^To:.*)(^*+:/$)  is what I THINK it should be, doesnt work 
> though.  Can anyone help me out?

>From procmail:

(^((Original-)?(Resent-)?(To|Cc|Bcc)|(X-Envelope|Apparently(-Resent)?)-To):(
.*[^-a-zA-Z0-9_.])?)

Dunno if that's Perl syntax though.

Hal




More information about the Kclug mailing list