Open-Source-Software-Entwicklung und Downloads

Browse Subversion Repository

Annotation of /trunk/doc/en/html/macro/command/waitregex.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3221 - (hide annotations) (download) (as text)
Tue Mar 24 09:37:20 2009 UTC (15 years, 2 months ago) by maya
File MIME type: text/html
File size: 2241 byte(s)
CVS から SVN へ移行: trunk に集約
1 maya 332 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
2     "http://www.w3.org/TR/html4/strict.dtd">
3 maya 572 <html>
4     <head>
5     <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6     <title>waitregex</title>
7     <meta http-equiv="Content-Style-Type" content="text/css">
8     <link rel="stylesheet" href="../../style.css" type="text/css">
9     </head>
10 yutakakn 194
11 maya 572 <body>
12 yutakakn 194
13    
14 maya 572 <h1>waitregex</h1>
15 yutakakn 194
16 maya 572 <p>
17     Waits a line that contains string with regular expression.
18     </p>
19 yutakakn 194
20 maya 572 <pre class="macro-syntax">
21     waitregex &lt;string1 with regular expression&gt; [&lt;string2 with regular expression&gt; ...]
22 yutakapon 1083 mwaitregex &lt;string1 with regular expression&gt; [&lt;string2 with regular expression&gt; ...]
23 maya 572 </pre>
24 yutakakn 194
25 maya 572 <h2>Remarks</h2>
26 yutakakn 194
27 maya 572 <p>
28     Supports <a href="../../reference/RE.txt">Oniguruma Regular Expressions</a>.<br>
29 maya 1107 Pauses until the string (maximum 256 characters), which matches one or more character strings with regular expression is received from the host, or until the timeout occurs. Maximum number of the regular expression strings is 10.
30     </p>
31 yutakapon 1083
32 maya 1107 <p>
33     If the system variable "timeout" or "mtimeout" is greater than zero, the timeout occurs when &lt;timeout&gt;.&lt;mtimeout&gt; seconds have passed. If the timeout is less than or equal to zero, the timeout never occurs.
34     </p>
35    
36     <p>
37 yutakapon 1083 These commands return one of the following values in the system variable "result":
38 maya 572 </p>
39 yutakakn 194
40 maya 572 <table>
41     <tr>
42     <th>Value</th>
43     <th>Meaning</th>
44     </tr>
45     <tr>
46     <td>0</td>
47     <td>Timeout.</td>
48     </tr>
49     <tr>
50     <td>1</td>
51     <td>&lt;string1 with regular expression&gt; has received.</td>
52     </tr>
53     <tr>
54     <td>2</td>
55     <td>&lt;string2 with regular expression&gt; has received.</td>
56     </tr>
57     <tr>
58     <td>n</td>
59     <td>&lt;stringn with regular expression&gt; has received. n=1..10.</td>
60     </tr>
61     </table>
62 yutakakn 194
63 maya 572 <p>
64     The received line is stored in the system variable "inputstr".<br>
65     The first matched pattern is stored in the system variable "matchstr".<br>
66 yutakakn 194 Group matched patterns of regular expressions are stored in 9 system variables from "groupmatchstr1" to "groupmatchstr9".
67 maya 572 </p>
68 yutakakn 194
69 maya 572 <h2>Example</h2>
70 yutakakn 206
71 maya 572 <pre class="macro-example">
72 maya 1034 timeout = 30
73 maya 572 waitregex 'Longhorn' '.*@sai' 'Pentium\d+' 'TeraTermX{3}'
74     int2str s result
75     messagebox s 'result'
76     messagebox inputstr 'inputstr'
77     messagebox matchstr 'matchstr'
78 maya 1034 </pre>
79 yutakakn 194
80 maya 572 </body>
81     </html>

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26