Re: Is there any function to test for numeric ips?

From: "Fernando Hevia" <fhevia(at)ip-tel(dot)com(dot)ar>
To: "'Fernando Hevia'" <fhevia(at)ip-tel(dot)com(dot)ar>, "'Oliveiros C,'" <oliveiros(dot)cristina(at)marktest(dot)pt>, <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Is there any function to test for numeric ips?
Date: 2009-12-11 16:26:00
Message-ID: 52EA9FD8B55A43D7B06F4B97DCC88DFE@iptel.com.ar
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

>
> You could filter IP out with a regular expression:
>
> select hostname as hosts_not_ip
> from table
> where hostname !~ '^[0-9]\.[0-9]\.[0-9]\.[0-9]$'
>

Oops, i missed something. Its:

select hostname as hosts_not_ip
from table
where hostname !~ '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}$'

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Alvaro Herrera 2009-12-11 16:28:47 Re: Is there any function to test for numeric ips?
Previous Message Harald Fuchs 2009-12-11 16:23:47 Re: Is there any function to test for numeric ips?