

Task

   match a string against a regular expression
   substitute part of a string using a regular expression


$string = "I am a string";
if ($string =~ /string$/) {
   print "Ends with 'string'\n";
}
 
if ($string !~ /^You/) {
   print "Does not start with 'You'\n";
}