

Task

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


 
str = "This is a string"
if str =~ ~r/string$/, do: IO.inspect "str ends with 'string'"
 