Search Postgresql Archives

Re: Fwd: help on postgres regexp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 6 May 2010 15:52, Nicholas I <nicholas.domnic.i@xxxxxxxxx> wrote:


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


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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux