in reply to One line assigment statement with regex match
something like:
@terms = ("Word1","Word2","Word3"); $match = $1 if join (" ", @terms) =~ /((?:^| )$lineFromSomeTextFile(?: + |$))/; [download]