[expect] strange error (re)

Discussion in 'C++' started by Sektor van Skijlen, Sep 14, 2004.

  1. 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.
     
    Sektor van Skijlen, Sep 14, 2004
    #1
    1. Advertising

  2. 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
     
    Thomas Matthews, Sep 14, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. wildt

    Error Too few parameteres expect 1

    wildt, Jul 21, 2003, in forum: ASP General
    Replies:
    3
    Views:
    97
    jbongran
    Jul 24, 2003
  2. Flokke

    to few parameters. Expect 2 - error

    Flokke, Sep 16, 2003, in forum: ASP General
    Replies:
    1
    Views:
    104
    Aaron Bertrand [MVP]
    Sep 16, 2003
  3. Simon Strandgaard

    how to expect eof with expect+pty

    Simon Strandgaard, Dec 20, 2006, in forum: Ruby
    Replies:
    4
    Views:
    390
    Simon Strandgaard
    Dec 20, 2006
  4. Amos

    odd error with expect

    Amos, Feb 15, 2007, in forum: Ruby
    Replies:
    2
    Views:
    94
    Brian Candler
    Feb 27, 2007
  5. Phil
    Replies:
    0
    Views:
    181
Loading...

Share This Page