translation updated for string.
[scilab.git] / scilab / modules / string / help / ja_JP / strindex.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5  * Copyright (C) INRIA - 
6  * 
7  * This file must be used under the terms of the CeCILL.
8  * This source file is licensed as described in the file COPYING, which
9  * you should have received as part of this distribution.  The terms
10  * are also available at    
11  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
12  *
13  -->
14
15 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="strindex" xml:lang="ja">
16     
17     <refnamediv>
18         
19         <refname>strindex</refname>
20         
21         <refpurpose>他の文字列の中で指定した文字列の位置を探す.</refpurpose>
22         
23     </refnamediv>
24     
25     <refsynopsisdiv>
26         
27         <title>呼び出し手順</title>
28         
29         <synopsis>
30             
31             ind = strindex(haystack, needle, [flag])
32             
33             [ind, which] = strindex(haystack, needle, [flag])
34             
35         </synopsis>
36         
37     </refsynopsisdiv>
38     
39     <refsection>
40         
41         <title>引数</title>
42         
43         <variablelist>
44             
45             <varlistentry>
46                 
47                 <term>haystack</term>
48                 
49                 <listitem>
50                     
51                     <para>
52                         
53                         文字列. 
54                         
55                         <varname>needle</varname>が現れる場所を探す文字列
56                         
57                     </para>
58                     
59                 </listitem>
60                 
61             </varlistentry>
62             
63             <varlistentry>
64                 
65                 <term>needle</term>
66                 
67                 <listitem>
68                     
69                     <para>
70                         
71                         文字列または文字列ベクトル. 
72                         
73                         <varname>haystack</varname>で探す文字列
74                         
75                     </para>
76                     
77                 </listitem>
78                 
79             </varlistentry>
80             
81             <varlistentry>
82                 
83                 <term>ind</term>
84                 
85                 <listitem>
86                     
87                     <para>添字のベクトル</para>
88                     
89                 </listitem>
90                 
91             </varlistentry>
92             
93             <varlistentry>
94                 
95                 <term>which</term>
96                 
97                 <listitem>
98                     
99                     <para>添字のベクトル</para>
100                     
101                 </listitem>
102                 
103             </varlistentry>
104             
105             <varlistentry>
106                 
107                 <term>flag</term>
108                 
109                 <listitem>
110                     
111                     <para>
112                         文字列(<literal>"r"</literal>の場合は正規表現)
113                     </para>
114                     
115                 </listitem>
116                 
117             </varlistentry>
118             
119         </variablelist>
120         
121     </refsection>
122     
123     <refsection>
124         
125         <title>説明</title>
126         
127         <para>
128             
129             <function>strindex</function>は,
130             
131             <varname>haystack</varname>の中で<literal>needle(i)</literal>が
132             
133             見つかる場所のインデックスを探します.
134             
135         </para>
136         
137         <para>
138             
139             各<literal>k</literal>に関して,
140             
141             <literal>part(haystack,ind(k)+(0:length(needle(i))-1))</literal>
142             
143             が<literal>needle(i)</literal>と同じ文字列となるよな
144             
145             <literal>i</literal>が存在します.
146             
147             <varname>which</varname>引数が必要な場合,
148             
149             これにはこれらの<literal>i</literal>が含まれる必要があります.
150             
151             3番目のパラメータ<literal>"r"</literal>を指定する場合,
152             
153             <varname>needle</varname>は正規表現の文字列とする必要があります.
154             
155             この場合, <function>strindex</function>は正規表現式の規則に基づき
156             
157             <varname>haystack</varname>を検索します.
158             
159         </para>
160         
161         <para>
162             
163             正規表現式引数を指定しない<function>strindex</function>は
164             
165             Knuth-Morris-Prattアルゴリズムに基づきます.
166             
167         </para>
168         
169         <para>
170             
171             このアルゴリズムは Scilab 4.x で使用されるものよりも
172             
173             より強力です. いくつかの特殊なケースでは,結果が異なることがあります.
174             
175         </para>
176         
177         <para>例:</para>
178         
179         <para>// Scilab 5.x</para>
180         
181         <para>--&gt;[k,w]=strindex('aab',['a','ab'])</para>
182         
183         <para>w = 1. 1. 2. k = 1. 2. 2.</para>
184         
185         <para>// Scilab 4.x</para>
186         
187         <para>--&gt;[k,w]=strindex('aab',['a','ab'])</para>
188         
189         <para>w = 1. 1. k = 1. 2.</para>
190         
191         <para>
192             
193             正規表現の規則はPerl言語に似ていますT. 使い始めるには,
194             
195             <ulink url="http://perldoc.perl.org/perlrequick.html">http://perldoc.perl.org/perlrequick.html</ulink>を参照してください.
196             
197             より詳細なチュートリアルについては <ulink url="http://perldoc.perl.org/perlretut.html">http://perldoc.perl.org/perlretut.html</ulink>
198             
199             を参照ください.
200             
201             リファレンスについては, <ulink url="http://perldoc.perl.org/perlre.html">http://perldoc.perl.org/perlre.html</ulink>
202             
203             を参照してください
204             
205         </para>
206         
207     </refsection>
208     
209     <refsection>
210         
211         <title>例</title>
212         
213         <programlisting role="example"><![CDATA[ 
214 k=strindex('SCI/demos/scicos','/')
215 k=strindex('SCI/demos/scicos','SCI/')
216 k=strindex('SCI/demos/scicos','!')
217 k=strindex('aaaaa','aa') 
218 k=strindex('SCI/demos/scicos',['SCI','sci'])
219 [k,w]=strindex('1+3*abc/2.33',['+','-','*','/'])
220 k=strindex('2' ,'/2(]*)?$\1/' ,'r') 
221  ]]></programlisting>
222         
223     </refsection>
224     
225     <refsection role="see also">
226         
227         <title>参照</title>
228         
229         <simplelist type="inline">
230             
231             <member>
232                 
233                 <link linkend="string">string</link>
234                 
235             </member>
236             
237             <member>
238                 
239                 <link linkend="strings">strings</link>
240                 
241             </member>
242             
243             <member>
244                 
245                 <link linkend="regexp">regexp</link>
246                 
247             </member>
248             
249             <member>
250                 
251                 <link linkend="strsubst">strsubst</link>
252                 
253             </member>
254             
255         </simplelist>
256         
257     </refsection>
258     
259 </refentry>
260