is_valid__match Function

public function is_valid__match(pattern, str, correct_answer) result(res)

This function checks if a pattern matches exactly a string and compares the result to the correct answer.

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: pattern
character(len=*), intent(in) :: str
logical, intent(in) :: correct_answer

Return Value logical


Source Code

   function is_valid__match(pattern, str, correct_answer) result(res)
      implicit none
      character(*), intent(in) :: pattern, str
      logical,      intent(in) :: correct_answer

      logical :: res

      res = (pattern .match. str) .eqv. correct_answer
   end function is_valid__match