~ubuntu-branches/ubuntu/karmic/scilab/karmic

« back to all changes in this revision

Viewing changes to man/strings/grep.man

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2002-03-21 16:57:43 UTC
  • Revision ID: james.westby@ubuntu.com-20020321165743-e9mv12c1tb1plztg
Tags: upstream-2.6
ImportĀ upstreamĀ versionĀ 2.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
.TH grep 3 "April 1993" "Scilab Group" "Scilab Function"
 
2
.so ../sci.an
 
3
.SH NAME
 
4
grep - find matches of a string in a vector of strings
 
5
.SH CALLING SEQUENCE
 
6
.nf
 
7
row=grep(str1,str2)
 
8
[row,which]=grep(str1,str2)
 
9
.fi
 
10
.SH PARAMETERS
 
11
.TP 15
 
12
str1
 
13
: a vector of strings. 
 
14
.TP
 
15
str2
 
16
: a character string or character string vector . The string(s) to search in \fVstr1\fR
 
17
.TP
 
18
row
 
19
: vector of  indices: row where a match has been found or an empty
 
20
matrix if no match found.
 
21
.TP
 
22
which
 
23
: vector of indices: index of str2 string found or an empty
 
24
matrix if no match found.
 
25
 
 
26
.SH DESCRIPTION
 
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.
 
31
 
 
32
.SH EXAMPLE
 
33
.nf
 
34
txt=['find matches of a string in a vector of strings'
 
35
     'search position of a character string in an other string'
 
36
     'Compare Strings'];
 
37
 
 
38
grep(txt,'strings')
 
39
grep(txt,['strings' 'Strings'])
 
40
 
 
41
[r,w]=grep(txt,['strings' 'Strings'])
 
42
 
 
43
.fi
 
44
.SH SEE ALSO
 
45
strindex
 
46
 
 
47