Need a help in regexp

From: Nicholas I <nicholas(dot)domnic(dot)i(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Need a help in regexp
Date: 2010-05-06 14:48:26
Message-ID: k2oe13d0d11005060748l4eaf0ac2g9b1db464c524b8e4@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-sql

Hi,

Need a help in regexp!

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

i have written a query,
*select regexp_matches(name,'([^(]+)([)]+)','g') from table;*
which outputs the data as,
{"test"}
{"test2"}

Thank You
Nicholas I

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nicholas I 2010-05-06 14:52:36 Fwd: help on postgres regexp
Previous Message Dave Vitek 2010-05-06 14:44:34 pre-existing shared memory block is still in use after crashes

Browse pgsql-sql by date

  From Date Subject
Next Message Nicholas I 2010-05-06 14:53:01 Fwd: Need a help in regexp
Previous Message Thomas Kellerer 2010-05-06 14:37:55 Re: How to get localized to_char(DATE) output