      integer function jmatch (text, master)

      character*(*) text, master
      character*1 syma, symb
      logical match

      jmatch = 0
      lentxt = len(text)
      lenmst = len(master)
      if (lentxt .le. lenmst) then
        i = 1
        match = .true.
        do while (i .le. lentxt .and. match)
          syma = text(i:i)
          symb = master(i:i)
          call shiftup (syma)
          call shiftup (symb)
          match = syma .eq. symb
          if (match) i = i + 1
        end do
        jmatch = i - 1
      end if
      return
      end
