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
In reply to Regex to match multiple words in an email subject by brainfold
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |