brainfold has asked for the wisdom of the Perl Monks concerning the following question:
I am writing a script for Resource Tracker to look for specific key words in a email subject and send them to different queue name
.This script below works for single search word, but i wanted to use multiple key word
my $match = (".*SSL.*"|".*SSL Certificate.*"|".*VASCO.*"); my $t_subject = $self->TicketObj->Subject; if ( $t_subject !~ /$match/i ) { return 0; } else { return 1; }
Issuemy $newqueue = "Key Management"; my $T_Obj = $self->TicketObj; $RT::Logger->info("Auto assign ticket #". $T_Obj->id ." to queue #". $ +newqueue ); my ($status, $msg) = $T_Obj->SetQueue($newqueue); unless ($status) { $RT::Logger->warning("unable to set new queue: $msg"); return undef; } return 1;
Here the issue is with the $match, the script works when i have only one key word. Say if i have more than one key word (in this instance SSL, SSL Certificates, Vasco)then the script is not working.
Is there any alternate way i can follow to overcome this
Can any one please help me out with this??, Please
Thanks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex to match multiple words in an email subject
by Anonymous Monk on Jan 07, 2011 at 04:51 UTC | |
|
Re: Regex to match multiple words in an email subject
by AnomalousMonk (Archbishop) on Jan 07, 2011 at 05:19 UTC | |
|
Re: Regex to match multiple words in an email subject
by philipbailey (Curate) on Jan 07, 2011 at 05:33 UTC | |
by jwkrahn (Abbot) on Jan 07, 2011 at 07:22 UTC | |
by philipbailey (Curate) on Jan 07, 2011 at 09:58 UTC | |
by JavaFan (Canon) on Jan 07, 2011 at 12:36 UTC |