is_valid_name Function

public pure function is_valid_name(name) result(is_valid)

Arguments

Type IntentOptional Attributes Name
character(len=*), intent(in) :: name

Return Value logical


Source Code

   pure logical function is_valid_name(name) result(is_valid)
      character(len=*), intent(in) :: name

      is_valid =  len(name) > 0
      if (.not. is_valid) return

      is_valid = (verify(name(1:1), LOWER // UPPER) == 0)
      if (.not. is_valid) return
      
      is_valid = (verify(name(2:), LOWER // UPPER // DIGITS // '_') == 0)

   end function is_valid_name