Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > [expect] strange error (re)

Reply
Thread Tools

[expect] strange error (re)

 
 
Sektor van Skijlen
Guest
Posts: n/a
 
      09-14-2004

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.
 
Reply With Quote
 
 
 
 
Thomas Matthews
Guest
Posts: n/a
 
      09-14-2004
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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Strange error "Internal Server Error" Sam ASP General 2 11-16-2007 01:39 PM
AVG Email Scanner activating at strange times with strange IP addresses dennispublic@hotmail.com Computer Support 1 08-26-2006 04:27 AM
Quartus II error - use clause error... - very strange behaviour Jan VHDL 2 12-16-2004 03:33 PM
Question About Strange 'C' Code Syntax ( Well strange to me anyway ) Harvey Twyman C Programming 8 10-25-2003 05:54 AM
Strange error in Quartus II 3.0 Panic VHDL 2 10-24-2003 01:42 AM



Advertisments