Browse Subversion Repository
Contents of /trunk/doc/en/html/macro/command/waitregex.html
Parent Directory
| Revision Log
1 |
<HTML> |
2 |
<HEAD> |
3 |
<TITLE>waitregex</TITLE> |
4 |
<link rel="stylesheet" href="../../style.css" type="text/css"> |
5 |
</HEAD> |
6 |
<BODY> |
7 |
|
8 |
<DIV ALIGN="left"> |
9 |
<FONT SIZE="+2">waitregex</FONT><BR><BR> |
10 |
</div> |
11 |
|
12 |
Format: |
13 |
<UL> |
14 |
<B>waitregex <string1 with regular expression> <string2 with regular expression> ...</B></UL> |
15 |
<P></P> |
16 |
|
17 |
Supports <A HREF="../../reference/RE.txt">Oniguruma Regular Expressions</A>. |
18 |
<P></P> |
19 |
|
20 |
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. |
21 |
<P></P> |
22 |
|
23 |
If the system variable "timeout" is greater than zero, the timeout occurs when <timeout> seconds have passed. If the "timeout" is less than or equal to zero, the timeout never occurs. |
24 |
<P></P> |
25 |
|
26 |
|
27 |
The "waitregex" command returns one of the following values in the system variable "result": |
28 |
<P></P> |
29 |
|
30 |
<pre> |
31 |
Value Meaning |
32 |
<hr> |
33 |
0 Timeout. No string, which satisfies the condition, has been received. |
34 |
1 <string1 with regular expression> has received. |
35 |
2 <string2 with regular expression> has received. |
36 |
n <stringn with regular expression> has received. n=1..10. |
37 |
</pre> |
38 |
<P></P> |
39 |
|
40 |
The received line is stored in the system variable "inputstr". |
41 |
The first matched pattern is stored in the system variable "matchstr". |
42 |
Group matched patterns of regular expressions are stored in 9 system variables from "groupmatchstr1" to "groupmatchstr9". |
43 |
<P></P> |
44 |
|
45 |
<pre> |
46 |
Example: |
47 |
timeout = 30 |
48 |
waitregex 'Longhorn' '.*@sai' 'Pentium\d+' 'TeraTermX{3}' |
49 |
int2str s result |
50 |
messagebox s 'result' |
51 |
messagebox inputstr 'inputstr' |
52 |
messagebox matchstr 'matchstr' |
53 |
</pre> |
54 |
|
55 |
</BODY> |
56 |
</HTML> |
57 |
|
|