

Task

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


var str = "I am a string";
if (str =~ /string$/) {
    print "Ends with 'string'\n";
}