not like perl..

From: hook <hook(at)lota(dot)us>
To: pgsql-general(at)postgresql(dot)org
Subject: not like perl..
Date: 2011-03-29 14:18:05
Message-ID: 4D91EA1D.5000405@lota.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I have a simple table with a varchar(32) field that I am trying to
extract data using regular expressions.

select * from spam where inetaddr like '100.%'
row | inetaddr | tdate
------+--------------+---------------------------
3245 | 100.81.98.51 | 03/08/2011 07:21:19.29209 -----works fine

select * from spam where inetaddr like E'\d\d\d.%'
row | inetaddr | tdate
-----+----------+-------
(0
rows)
--- zip ???????????

slect * from spam where inetaddr like E'\d.%'
row | inetaddr | tdate
-------+--------------------------------+----------------------------
49424 | d(dot)russell_ul(at)jdmarketing(dot)co(dot)uk | 03/27/2011 15:46:41.110566
??????????? though \d was a digit match????

select * from spam where inetaddr like E'\\d.%'
row | inetaddr | tdate
-------+--------------------------------+----------------------------
49424 | d(dot)russell_ul(at)jdmarketing(dot)co(dot)uk | 03/27/2011 15:46:41.110566
???????????

What am I doing wrong???

thanks

hook(at)lota(dot)us

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Harald Armin Massa 2011-03-29 14:23:45 Re: postgresql-9.0 service starting problem
Previous Message Ogden 2011-03-29 14:11:53 Load Increase