Re: regex match
| From: | Chris Knipe | Date: | Sat, 19 Apr 2003 16:24:28 +0000 |
| Subject: | Re: regex match | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-144486@lists.php.net to get a copy of this message | ||
Well...
I don't have a RH box here, *now*, but from a quick search on the
internet...
RedHat Output:
[root@deep] /# host -a redhat.com
Trying null domain
rcode = 0 (Success), ancount=6
The following answer is not authoritative:
The following answer is not verified as authentic by the server:
redhat.com 8112 IN NS ns.redhat.com
redhat.com 8112 IN NS ns2.redhat.com
redhat.com 8112 IN NS ns3.redhat.com
redhat.com 8112 IN NS speedy.redhat.com
redhat.com 8112 IN A 207.175.42.154
redhat.com 11891 IN SOA ns.redhat.com noc.redhat.com(
2000021402 ;serial (version)
3600 ;refresh period
1800 ;retry refresh this often
604800 ;expiration period
86400 ;minimum TTL
)
For authoritative answers, see:
redhat.com 8112 IN NS ns.redhat.com
redhat.com 8112 IN NS ns2.redhat.com
redhat.com 8112 IN NS ns3.redhat.com
redhat.com 8112 IN NS speedy.redhat.com
Additional information:
ns.redhat.com 94507 IN A 207.175.42.153
ns2.redhat.com 94507 IN A 208.178.165.229
ns3.redhat.com 94507 IN A 206.132.41.213
speedy.redhat.com 8112 IN A 199.183.24.251
FreeBSD Output:
root@netsphere/# host -t SOA abc.com 192.168.1.1
Using domain server 192.168.1.1:
abc.com start of authority ns01.megalan.co.za savage.savage.za.org(
2003041901 ;serial (version)
10800 ;refresh period
3600 ;retry refresh this often
604800 ;expiration period
10800 ;minimum TTL
)
--
me
----- Original Message -----
From: "Jim Lucas" <phplist@zonedzero.net>
To: "Chris Knipe" <savage@savage.za.org>; <php-general@lists.php.net>
Sent: Saturday, April 19, 2003 6:14 PM
Subject: Re: [PHP] regex match
> can you give the results that would be returned for both systems?
>
> Jim
> ----- Original Message -----
> From: "Chris Knipe" <savage@savage.za.org>
> To: <php-general@lists.php.net>
> Sent: Saturday, April 19, 2003 9:05 AM
> Subject: [PHP] regex match
>
>
> > Lo all,
> >
> > I need some quick help with a regex match... Mainly because of the fact
> that
> > the output between RH and FreeBSD is different for a command....
> >
> > My output:
> > root@netsphere:/# /usr/bin/host -t soa abc.com 192.168.1.1
> > Using domain server 192.168.1.1:
> >
> > abc.com start of authority ns01.blah some.email(
> > 2003041901 ;serial (version)
> > 10800 ;refresh period
> > 3600 ;retry refresh this often
> > 604800 ;expiration period
> > 10800 ;minimum TTL
> > )
> >
> > the function:
> > function DigSerial($server,$zone) {
> > global $config;
> > $result =
$config->binhost -t soa '$zone'
> > '$server';
> > if(ereg("try again",$result)) {
> > return $result;
> > } else {
> > preg_match("/.*SOA [^\s\t]+ [^\s\t]+ ([^\s\t]+)/",$result,$serial);
> > if($serial[1]) {
> > return $serial[1];
> > } else {
> > return 'not available';
> > }
> > }
> > }
> >
> > Now, on RH, the function will work, seeing that RH's host -t returns the
> SOA
> > in one line... FreeBSD however doesn't... Any good regex's around for
> this?
> > I only need the serial number... Just the numbers.
> >
> > --
> > me
> >
> >
> > --
> > PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> >
> >
>