Re: array of regular expressions on a string

2003-08-14 Thread Rob Dixon
Ramprasad wrote: > > I have an array of regular exps of which I want to match any of them > in a string. How can I do this without eval. > > for eg. > > @array = ( > '/^to: myprog/mi', > '/^from: [EMAIL PROTECTED]/mi' > ); > > $STRING = read_mail_header(...); > > > foreach (@array) { >

RE: array of regular expressions on a string

2003-08-14 Thread EUROSPACE SZARINDAR
. } } or look into perldoc perlre Regards, Michel -Message d'origine- De: Ramprasad [mailto:[EMAIL PROTECTED] Date: mercredi 13 août 2003 08:51 À: [EMAIL PROTECTED] Objet: array of regular expressions on a string Hi all, I have an array of regular exps of whi

Re: array of regular expressions on a string

2003-08-14 Thread Ramprasad
Rob Dixon wrote: Ramprasad wrote: I have an array of regular exps of which I want to match any of them in a string. How can I do this without eval. for eg. @array = ( '/^to: myprog/mi', '/^from: [EMAIL PROTECTED]/mi' ); $STRING = read_mail_header(...); foreach (@array) { if($STRING=~

array of regular expressions on a string

2003-08-14 Thread Ramprasad
Hi all, I have an array of regular exps of which I want to match any of them in a string. How can I do this without eval. for eg. @array = ( '/^to: myprog/mi', '/^from: [EMAIL PROTECTED]/mi' ); $STRING = read_mail_header(...); foreach (@array) {

Re: array of regular expressions on a string

2003-08-14 Thread Rob Dixon
Ramprasad wrote: > > This was not cut pasted from my actual code. I cannot paste my 250 > line script here so I just wrote a hapazard relevant replica of what > I did. Fair enough! An even worse problem is where people's company standards prohibit decent coding, but I always bear in mind that what