$string = 'My Test Data'; $regex = '(?i)\btest\b'; print $string =~ $regex ? "Match\n" : "No match\n";