;+
; function GREP,strarray,strin,pos=pos,ignore=ignore
; return: index array of string contained STRIN
; /ignore - ignore upper/lower case  distinction  during  comparisons.
;
; Ex: aa=string(indgen(10)*4)
; print,grep(aa,'8',pos=i),i
;-

function grep,strarray,strmask,pos=pos,ignore=ignore

 if keyword_set(ignore) then begin 
  strar=strupcase(strarray)
  strm=strupcase(strmask)
 endif else begin
  strar=strarray & strm=strmask
 end
 pos =-1
 nst=strpos(strar,strm)
 ii=nst 
 nst=where(ii ne (-1))
 if nst(0) eq (-1) then goto,aaa
 pos=ii(nst)
 aaa:return,nst
end