Help for this page

Select Code to Download


  1. or download this
    $string = 'My Test Data';
    print $string =~ m/\btest\b/i ? "Match\n" : "No match\n";
    
  2. or download this
    $string = 'My Test Data';
    $regex = '(?i)\btest\b';
    print $string =~ $regex ? "Match\n" : "No match\n";