[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] bb-services: regexes in expect string?
- To: "hobbit (at) hswn.dk" <hobbit (at) hswn.dk>
- Subject: Re: [hobbit] bb-services: regexes in expect string?
- From: KolbjÃrn Barmen <kolbjorn.barmen (at) uninett.no>
- Date: Wed, 24 Mar 2010 08:52:58 +0100 (CET)
- References: <1C7B7B9A7479234582BB043380014B9A131DF1311C (at) EXCHANGE-VS1.eharmony.com>
- User-agent: Alpine 2.01 (LNX 1266 2009-07-14)
On Wed, 2 Jul 2008, Aaron Zink wrote:
> Is it possible to use regexes in the expect string?
I'm wondering about the same, and haven't seen any answer to this.
I'm trying to match some xml, and first line is:
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
The problem is the quotes, as bbtest-net terminates the string on the
first quote, no matter what, it seems.
I have tried escaping like this:
expect "<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"no\"?>"
but "bbtest-net --services" shows "Exp.text: <?xml version=", adding more
\ doesnt help, the extra \ will then just be part of Exp.text.
I notice that --services show:
Exp.text: <?xml version=
Exp.len : 14
Exp.ofs : 0
All my services show "Exp.ofs : 0", I suppose "ofs" means offset?
Is there a way to set this to something else than 0?
The services I try to monitor also seems to puke out some ctrl-chars at
the start (and it it uses ssl), a connection with openssl s_client looks
like this:
[snip SSL stuff]
Verify return code: 19 (self signed certificate in certificate chain)
---
^ (at) ^@^D<FE><?xml version="1.0" encoding="UTF-8" standalone="no"?>
[snip rest of xml]
Should my "expect" also include "\x00\x00\x04\xFE" before "<?xml version"?
Again, if I could use regexp, I would probably just go for ".*<?xml ..",
and if offset can be used, I'd jump over the control chars.
Any tip?
--
KolbjÃrn Barmen
UNINETT Driftsenter