By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
432,275 Members | 936 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 432,275 IT Pros & Developers. It's quick & easy.

[expect] strange error (re)

P: n/a

couldn't compile regular expression pattern: quantifier operand invalid
while executing
"expect -nobrace >|#S {} -re {*
} { lappend response_line $expect_out(buffer); exp_continue }"
invoked from within
"expect {
{>|#S} {}
-re "*\n" { lappend response_line $expect_out(buffer); exp_continue }
}"
The fragment of source code, which invokes this error:

set response_line {}

expect {
{>|#S} {}
-re "*\n" { lappend response_line $expect_out(buffer); exp_continue }
}

What I wanted to do is:

If ">|#S" received, stop reading. Otherwise append read line to the
response_line list and continue reading.

I can read the "end of response" in two ways: one of them is the string
above, another is a line, which looks as follows (the response also begins
from this string):
------ |-------------------------------------

(it is not constant the number of the first dashes - it depends on "something")

A very strange thing is that, when I had such pattern:
{-+ \|-+}

It matches the beginning of the response, then the cited above code is
executed. When there was {-+ \|-+} in the first expect's rule, the error
message was the same.

Or maybe somebody knows more appropriate way to do this?
--
1 6 1 7 4 4 2 548 g4bc7a4 66z 3xt7w v1y z9p1 120 32
(( Michal "Sektor" Malecki w4 66 64 73 7564 24 5 v 34 4
)) ektor van Skijlen 1 5 5 1 844 a v r z 4
Software engineer, Motorola GSG Poland 1 2 2a 1 4
WARNING: Opinions presented by me on usenet groups are my personal opinions
ONLY and are not connected to the employer.
Jul 22 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Sektor van Skijlen wrote:
couldn't compile regular expression pattern: quantifier operand invalid
while executing
"expect -nobrace >|#S {} -re {*
} { lappend response_line $expect_out(buffer); exp_continue }"
invoked from within
"expect {
{>|#S} {}
-re "*\n" { lappend response_line $expect_out(buffer); exp_continue }
}"

Are you sure you are posting to the correct newsgroup?
I couldn't find these identifiers in the _standard_ C++ specification:
expect
lappend
response_line
$
expect_out
exp_continue

Remember, this newsgroup, news:comp.lang.c++, discusses the
C++ language, not the C language and not the C# language.

Please read the welcome.txt and FAQs below.

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.comeaucomputing.com/learn/faq/
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 22 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.