$regex1 = (hello); $test="hello there!"; if ($test =~ /$regex1/) { print $1; }