This function checks if a pattern matches exactly a string and compares the result to the correct answer.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
character(len=*), | intent(in) | :: | pattern | |||
character(len=*), | intent(in) | :: | str | |||
logical, | intent(in) | :: | correct_answer |
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