1 |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" |
2 |
"http://www.w3.org/TR/html4/strict.dtd"> |
"http://www.w3.org/TR/html4/strict.dtd"> |
3 |
<html> |
<html> |
4 |
<head> |
<head> |
5 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
6 |
<title>waitregex</title> |
<title>waitregex</title> |
7 |
<meta http-equiv="Content-Style-Type" content="text/css"> |
<meta http-equiv="Content-Style-Type" content="text/css"> |
8 |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
9 |
</head> |
</head> |
10 |
|
|
11 |
<body> |
<body> |
12 |
|
|
13 |
|
|
14 |
<h1>waitregex</h1> |
<h1>waitregex</h1> |
15 |
|
|
16 |
<p> |
<p> |
17 |
Waits a line that contains string with regular expression. |
Waits a line that contains string with regular expression. |
18 |
</p> |
</p> |
19 |
|
|
20 |
<pre class="macro-syntax"> |
<pre class="macro-syntax"> |
21 |
waitregex <string1 with regular expression> [<string2 with regular expression> ...] |
waitregex <string1 with regular expression> [<string2 with regular expression> ...] |
22 |
mwaitregex <string1 with regular expression> [<string2 with regular expression> ...] |
mwaitregex <string1 with regular expression> [<string2 with regular expression> ...] |
23 |
</pre> |
</pre> |
24 |
|
|
25 |
<h2>Remarks</h2> |
<h2>Remarks</h2> |
26 |
|
|
27 |
<p> |
<p> |
28 |
Supports <a href="../../reference/RE.txt">Oniguruma Regular Expressions</a>.<br> |
Supports <a href="../../reference/RE.txt">Oniguruma Regular Expressions</a>.<br> |
29 |
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. |
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> |
</p> |
31 |
|
|
32 |
<p> |
<p> |
33 |
If the system variable "timeout" or "mtimeout" is greater than zero, the timeout occurs when <timeout>.<mtimeout> seconds have passed. If the timeout is less than or equal to zero, the timeout never occurs. |
If the system variable "timeout" or "mtimeout" is greater than zero, the timeout occurs when <timeout>.<mtimeout> seconds have passed. If the timeout is less than or equal to zero, the timeout never occurs. |
34 |
</p> |
</p> |
35 |
|
|
36 |
<p> |
<p> |
37 |
These commands return one of the following values in the system variable "result": |
These commands return one of the following values in the system variable "result": |
38 |
</p> |
</p> |
39 |
|
|
40 |
<table> |
<table> |
41 |
<tr> |
<tr> |
42 |
<th>Value</th> |
<th>Value</th> |
43 |
<th>Meaning</th> |
<th>Meaning</th> |
44 |
</tr> |
</tr> |
45 |
<tr> |
<tr> |
46 |
<td>0</td> |
<td>0</td> |
47 |
<td>Timeout.</td> |
<td>Timeout.</td> |
48 |
</tr> |
</tr> |
49 |
<tr> |
<tr> |
50 |
<td>1</td> |
<td>1</td> |
51 |
<td><string1 with regular expression> has received.</td> |
<td><string1 with regular expression> has received.</td> |
52 |
</tr> |
</tr> |
53 |
<tr> |
<tr> |
54 |
<td>2</td> |
<td>2</td> |
55 |
<td><string2 with regular expression> has received.</td> |
<td><string2 with regular expression> has received.</td> |
56 |
</tr> |
</tr> |
57 |
<tr> |
<tr> |
58 |
<td>n</td> |
<td>n</td> |
59 |
<td><stringn with regular expression> has received. n=1..10.</td> |
<td><stringn with regular expression> has received. n=1..10.</td> |
60 |
</tr> |
</tr> |
61 |
</table> |
</table> |
62 |
|
|
63 |
<p> |
<p> |
64 |
The received line is stored in the system variable "inputstr".<br> |
The received line is stored in the system variable "inputstr".<br> |
65 |
The first matched pattern is stored in the system variable "matchstr".<br> |
The first matched pattern is stored in the system variable "matchstr".<br> |
66 |
Group matched patterns of regular expressions are stored in 9 system variables from "groupmatchstr1" to "groupmatchstr9". |
Group matched patterns of regular expressions are stored in 9 system variables from "groupmatchstr1" to "groupmatchstr9". |
67 |
</p> |
</p> |
68 |
|
|
69 |
<h2>Example</h2> |
<h2>Example</h2> |
70 |
|
|
71 |
<pre class="macro-example"> |
<pre class="macro-example"> |
72 |
timeout = 30 |
timeout = 30 |
73 |
waitregex 'Longhorn' '.*@sai' 'Pentium\d+' 'TeraTermX{3}' |
waitregex 'Longhorn' '.*@sai' 'Pentium\d+' 'TeraTermX{3}' |
74 |
int2str s result |
int2str s result |
75 |
messagebox s 'result' |
messagebox s 'result' |
76 |
messagebox inputstr 'inputstr' |
messagebox inputstr 'inputstr' |
77 |
messagebox matchstr 'matchstr' |
messagebox matchstr 'matchstr' |
78 |
</pre> |
</pre> |
79 |
|
|
80 |
</body> |
</body> |
81 |
</html> |
</html> |