is_there_caret_at_the_top Function

public pure function is_there_caret_at_the_top(pattern) result(res)

This function returns .true. if the pattern contains the caret character at the top that matches the beginning of a line.

Arguments

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

Return Value logical


Source Code

   pure function is_there_caret_at_the_top(pattern) result(res)
      implicit none
      character(*), intent(in) :: pattern
      character(:), allocatable :: buff
      logical :: res

      res = .false.

      buff = adjustl(pattern)
      if (len(buff) == 0) return

      res = buff(1:1) == '^'
   end function is_there_caret_at_the_top