in reply to Re: regex match in array
in thread regex match in array

Not sure how I should do this but i have a follow-up question. Should it be posted as a new node or in reply...?
Anyway this time I'll do it as a reply and if it is the wrong thing just let me know.

The question is:
How can i get the match to match at least a whole item from the array?
i.e.
#!/usr/bin/perl use strict; use warnings; my @myTerms = ( 'blah foo', 'test' ); my $term = "blah"; if ( grep /\Q$term\E/, @myTerms) { print "$term does match\n"; } # end-if exit;
will match, but i would only like it to match if the _term_ is /^blah foo(.*)/
Could you help me out?
Cheers,
Reagen