$words_to_match = 'Hello\s+World'; $output_line = /$words_to_match/ix ;