1
.TH grep 3 "April 1993" "Scilab Group" "Scilab Function"
4
grep - find matches of a string in a vector of strings
8
[row,which]=grep(str1,str2)
13
: a vector of strings.
16
: a character string or character string vector . The string(s) to search in \fVstr1\fR
19
: vector of indices: row where a match has been found or an empty
20
matrix if no match found.
23
: vector of indices: index of str2 string found or an empty
24
matrix if no match found.
27
Foreach entry of \fVstr1\fR, \fVgrep \fR searches if at least a string in
28
\fVstr2\fR matches a substring. \fVstr1\fR entries index where at least a match has been
29
found are returned in the \fVrow\fR argument. while optionnal
30
\fVwhich\fR argument gives the index of first string of \fVstr2\fR found.
34
txt=['find matches of a string in a vector of strings'
35
'search position of a character string in an other string'
39
grep(txt,['strings' 'Strings'])
41
[r,w]=grep(txt,['strings' 'Strings'])