Re: Fwd: help on postgres regexp

Поиск
Список
Период
Сортировка
От Thom Brown
Тема Re: Fwd: help on postgres regexp
Дата
Msg-id i2sbddc86151005060803x3b9c3a89lef7b0743513d1aec@mail.gmail.com
обсуждение исходный текст
Ответ на Fwd: help on postgres regexp  (Nicholas I <nicholas.domnic.i@gmail.com>)
Список pgsql-general
On 6 May 2010 15:52, Nicholas I <nicholas.domnic.i@gmail.com> wrote:


---------- Forwarded message ----------
From: Nicholas I <nicholas.domnic.i@gmail.com>
Date: Wed, May 5, 2010 at 8:35 AM
Subject: help
To: pgsql-sql@postgresql.org


Hi,

I have a table in which the data's are entered like,

Example:

One (1)
Two (2)
Three (3)

I want to extract the data which is only within the parentheses.

that is
1
2
3


Thank You
Nicholas I



Use a regular expression:

SELECT substring('this is a test(22)' from '\([0-9]+\)');

This would return 22.

Regards

Thom

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

Предыдущее
От: Nicholas I
Дата:
Сообщение: Fwd: Need a help in regexp
Следующее
От: Thom Brown
Дата:
Сообщение: Re: I need to take metadata from a shell script.