I'm not clear what I'm doing wrong in my cont check in bb-hosts, and I was hoping someone could help me out. My regular expression works fine in perl: perl -e '$text = join "", <>; if ($text =~ /assetID="[0-9A-Fa-f]{8}"/) { print "OK\n"; } else { print "NotOK\n"; }' < /tmp/vodbrowser.php
However, bb-hosts line fails on the regex check: 10.100.104.53 seachange-vod # testip cont=vod;http://mrteeny/vod/vodbrowser.php;assetID="[0-9A-Fa-f]{8}"
It *is* a webpage I'm trying to match... so the page starts with:
<html> <head> <title>VOD Interface</title> </head> <body bgcolor=white> <h3 align=center>Vod Interface</h3> <pre>
assetID="00080002"
However, I really only care if the assetID is being displayed. Any suggestions?
Hmm. Hobbit seems to have not liked the digit range.
Using assetID="[0-9abcdefABCDEF]{8}" is working. I'm not clear *why* Hobbit didn't like my digit range when perl did, and I'm curious to figure it out, but for now I'm happy that my check works.
From: Kimberly McKinnis [mailto:kmckinnis at tivo.com] Sent: Tuesday, August 26, 2008 4:25 PM To: hobbit at hswn.dk Subject: [hobbit] cont check regex problems
I'm not clear what I'm doing wrong in my cont check in bb-hosts, and I was hoping someone could help me out. My regular expression works fine in perl: perl -e '$text = join "", <>; if ($text =~ /assetID="[0-9A-Fa-f]{8}"/) { print "OK\n"; } else { print "NotOK\n"; }' < /tmp/vodbrowser.php
However, bb-hosts line fails on the regex check: 10.100.104.53 seachange-vod # testip cont=vod;http://mrteeny/vod/vodbrowser.php;assetID="[0-9A-Fa-f]{8}"
It *is* a webpage I'm trying to match... so the page starts with:
<html> <head> <title>VOD Interface</title> </head> <body bgcolor=white> <h3 align=center>Vod Interface</h3> <pre>
assetID="00080002"
However, I really only care if the assetID is being displayed. Any suggestions?
Kimberly McKinnis wrote:
Hmm. Hobbit seems to have not liked the digit range.
Using assetID="[0-9abcdefABCDEF]{8}" is working. I’m not clear **why** Hobbit didn’t like my digit range when perl did, and I’m curious to figure it out, but for now I’m happy that my check works.
A handy tool for checking Perl-compatible regexes is pcretest, which is a more direct way of checking since it uses libpcre like hobbit does.
-- S i m e o n B e r k l e y
Systems Engineer Mcclatchy Interactive
Thank you much!
-----Original Message----- From: Simeon Berkley [mailto:sberkley at mcclatchyinteractive.com] Sent: Wednesday, August 27, 2008 7:07 AM To: hobbit at hswn.dk Subject: Re: [hobbit] cont check regex problems
Kimberly McKinnis wrote:
Hmm. Hobbit seems to have not liked the digit range.
Using assetID="[0-9abcdefABCDEF]{8}" is working. I'm not clear **why**
Hobbit didn't like my digit range when perl did, and I'm curious to figure it out, but for now I'm happy that my check works.
A handy tool for checking Perl-compatible regexes is pcretest, which is a more direct way of checking since it uses libpcre like hobbit does.
-- S i m e o n B e r k l e y
Systems Engineer Mcclatchy Interactive
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
I need to check the log string "ERROR |", but i don't know the right way to use the character "|" not as OR I know that not exits a escape character in hobbit regex.
Any suggestions,
Thanks
Escape character is \
Lars
----- Original Message ----- From: "Marco Avvisano" <marco.avvisano at regione.toscana.it> To: <hobbit at hswn.dk> Sent: Wednesday, September 03, 2008 9:13 AM Subject: [hobbit] regex question
I need to check the log string "ERROR |", but i don't know the right way to use the character "|" not as OR I know that not exits a escape character in hobbit regex.
Any suggestions,
Thanks
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
I try to insert "\" in my hobbit-client.cfg, but not work
LOG /mylog.log %ERROR*\| COLOR=red
May be that i remember that Henrik say that no escape character are required?
Marco
----- Original Message ----- From: "Lars Ebeling" <lars.ebeling at leopg9.no-ip.org> To: <hobbit at hswn.dk> Sent: Wednesday, September 03, 2008 12:19 PM Subject: Re: [hobbit] regex question
Escape character is \
Lars
----- Original Message ----- From: "Marco Avvisano" <marco.avvisano at regione.toscana.it> To: <hobbit at hswn.dk> Sent: Wednesday, September 03, 2008 9:13 AM Subject: [hobbit] regex question
I need to check the log string "ERROR |", but i don't know the right way to use the character "|" not as OR I know that not exits a escape character in hobbit regex.
Any suggestions,
Thanks
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
To unsubscribe from the hobbit list, send an e-mail to hobbit-unsubscribe at hswn.dk
In <004a01c90e5e$086bd890$2b01d59f at regione.toscana.it> "Marco Avvisano" <marco.avvisano at regione.toscana.it> writes:
I try to insert "\" in my hobbit-client.cfg, but not work
LOG /mylog.log %ERROR*\| COLOR=red
Shouldn't that be ".*" instead of just "*" ?
LOG /mylog.log %ERROR.*\| COLOR=red
I don't believe the backslash-escape is needed.
Henrik
participants (5)
-
henrik@hswn.dk
-
kmckinnis@tivo.com
-
lars.ebeling@leopg9.no-ip.org
-
marco.avvisano@regione.toscana.it
-
sberkley@mcclatchyinteractive.com