regular expression

Поиск
Список
Период
Сортировка
От fiona
Тема regular expression
Дата
Msg-id 420CEEE5.60409@blueyonder.co.uk
обсуждение исходный текст
Ответы Re: regular expression  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Список pgsql-general
My database table holds phone numbers that may contain characters other than digits (that's not a problem in itself).

I want to be able to apply a regular expression (to ignore all characters except digits) to the attribute 'phone' first
andthen for the ILIKE to compare 
the result to $telephone. I can't find any way of applying the RE to phone.

My current query without the RE is as follows:

SELECT telephone
FROM addresses
WHERE id = user_id
AND phone ILIKE '%".addslashes($telephone)."%'"

I want to do something like:  AND phone([^[:digit:]]) ILIKE $telephone
But this doesn't work.
Any ideas?

FB

--
Get Thunderbird <http://www.mozilla.org/products/thunderbird/>
<http://www.mozilla.org/products/thunderbird/>

В списке pgsql-general по дате отправления:

Предыдущее
От: Vittorio De Martino
Дата:
Сообщение: Re: pg_dump warnings
Следующее
От: Mike Harding
Дата:
Сообщение: updateable view with join?