[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [hobbit] PCRE Assistance
- To: hobbit (at) hswn.dk
- Subject: Re: [hobbit] PCRE Assistance
- From: Odinn <odinn_asgaard (at) yahoo.com>
- Date: Fri, 26 Mar 2010 13:45:52 -0700 (PDT)
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1269636352; bh=TaTCN1qx8iexRf8g38HZ9y4HABqUBLj/pP0G3zhGjdg=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=sT9J8VWq9RkWG0CLQqDTJyhtRgJrICDiP5iXX7YwB+2k+xHtkF+VamLMStFhITVi7qCeucFYB3YoajhUIX8uwTPMB1EqSyQXpPnU8Gy6aW+nBo3LsqEEiidP6j91G5fGm0OrZiZiclRr88x6zcFQz9aJ7RuKMZA+5aCM9sjbvL4=
- Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:X-YMail-OSG:Received:X-Mailer:References:Date:From:Subject:To:In-Reply-To:MIME-Version:Content-Type; b=J4Ogo2HeMT/9zITvSIawhijlQYBWS+2iTT5YgLmeFZfJc1qKGQYEHse+jDJt+Lq8FJXdlpKccc96Zp3i47X0N9qWzeoVyT9g753/4FPQVcLSPqmw4zqbVAi4SdG5utUv4AFuMqDLU6jbJ0+OytZAe29iMhmW30V/YNKQz3K/wcU=;
- References: <4BAD166C.1040308 (at) umdnj.edu>
Careful not to confuse globbing with regex
%(bbdisplay|xymon|katahdin|^netmon-.*).umdnj.edu
You were almost there. * means to match the previous character 0 or more times
. is any character, so .* is match any character 0 or more times.
.+ would be to match any character 1 or more times
This is different than globbing, where * means any character 0 or more times.
Common mistake for those not familiar with the intricacies or regex vs globbing.
--
Jim Sloan
Just remember, today is the day you thought tomorrow was going to be yesterday.
----- Original Message ----
From: Ryan Novosielski <novosirj (at) umdnj.edu>
To: hobbit (at) hswn.dk
Sent: Fri, March 26, 2010 4:17:48 PM
Subject: [hobbit] PCRE Assistance
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm feeling rather dopey at not being able to figure this out, but bear
with me.
I'm trying to define a regex that will match, among other things, a line
that begins with: netmon- and any number of characters that follow it,
and then ends with my domain name. The two I need it to match right now
are: "netmon-int.umdnj.edu" and "netmon-ext.umdnj.edu" but there may be
others going forward.
Here is my example:
%(bbdisplay|xymon|katahdin|^netmon-*).umdnj.edu
I was suspicious of the ^, so I tried removing it -- no change. So far
I've tried this list of things:
%(bbdisplay|xymon|katahdin|netmon-*).umdnj.edu
%(bbdisplay|xymon|katahdin|^netmon\-*).umdnj.edu
%(bbdisplay|xymon|katahdin|netmon\-*).umdnj.edu
...maybe one or two others. When I try either of the two hostnames I'm
trying to match with pcretest, I get "No match". Can anyone point me in
the right direction? It's surely something simple.
- --
---- _ _ _ _ ___ _ _ _
|Y#| | | |\/| | \ |\ | | |Ryan Novosielski - Systems Programmer II
|$&| |__| | | |__/ | \| _| |novosirj (at) umdnj.edu - 973/972.0922 (2-0922)
\__/ Univ. of Med. and Dent.|IST/CST - NJMS Medical Science Bldg - C630
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkutFmsACgkQmb+gadEcsb5ljQCfeHH215LC1dLo3guwlJkPzp4H
6MIAnRILcRuLfvoAsNY5/5uBLNM+QkEH
=eMzo
-----END PGP SIGNATURE-----
To unsubscribe from the hobbit list, send an e-mail to
hobbit-unsubscribe (at) hswn.dk