#!/usr/bin/perl use strict; use warnings; my @myTerms = ( 'foo bar', 'blah' ); my $term = "foo"; my ($match) = ( grep /\Q$term\E/, @myTerms ); print "$term does match with $match\n" if ($match);
In reply to Re: regex to return matched value from array
by zejames
in thread regex to return matched value from array
by rsiedl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |