Skip to content

strsfind.m

Basic Information

  SYNTAX:
          [jtext,ipatt] = strsfind(text,patterns);

  PURPOSE:  Multiple "patterns" version of "strfind"
            Finds patterns (1 or more rows) in single text (single row)
            NOTE: trailing blanks in patterns are removed

  INPUT:
         text=      single row of text (ex: '/home/leuer/tokamaks/nstx/efit/')
         patterns= patterns to search "text" (ex: ['east'; 'nstx'; 'iter'...])
                   NOTE: trailing blanks in patterns(ii,:) are removed

  OUTPUT:
         jtext=      index in text(j) of start of pattern
         ipatt=      row of patterns assoicated with a each particular jtext id
              note: jtext and ipatt have same length

  RESTRICTIONS:
         text and patterns must be type character; text is a single row

Dependencies