Man Scilab

grep
Scilab Function

grep - find matches of a string in a vector of strings

Calling Sequence

row=grep(str1,str2)
[row,which]=grep(str1,str2)

Parameters

Description

Foreach entry of str1 , grep searches if at least a string in str2 matches a substring. str1 entries index where at least a match has been found are returned in the row argument. while optionnal which argument gives the index of first string of str2 found.

Examples


txt=['find matches of a string in a vector of strings'
     'search position of a character string in an other string'
     'Compare Strings'];

grep(txt,'strings')
grep(txt,['strings' 'Strings'])

[r,w]=grep(txt,['strings' 'Strings'])

 
  

See Also

strindex ,  

Back