code: def apply_and_get_result(self, string):
          
          if self.is_multiline:
              compiled_pattern = re.compile(self.pattern, re.MULTILINE)
          else:
              compiled_pattern = re.compile(self.pattern)
  
          result = re.sub(compiled_pattern, self.repl, string)
          return result
docs: Perform the substitution represented by this object on string and return
          the result.