#!usr/bin/perl use strict; use warnings; # Variables that I will extract from the escel sheet my @steps_name = ("1-2 Steps", "5-7 Steps", "8-10 Steps", "11-15 Steps"); #regex that I want to match against foreach (@steps_name) { print "Matched with ".$_."\n" if /(?:\b8-10 Steps\b|\b11-15 Steps\b)/; } __END__ $ perl test.pl Matched with 8-10 Steps Matched with 11-15 Steps