Re: regexp_matches for digit

From: Andy Colson <andy(at)squeakycode(dot)net>
To: Ramesh T <rameshparnanditech(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, Pavel Stěhule <pavel(dot)stehule(at)gmail(dot)com>
Subject: Re: regexp_matches for digit
Date: 2015-07-09 16:50:44
Message-ID: 559EA664.70302@squeakycode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 7/9/2015 11:24 AM, Ramesh T wrote:
> Hi,
> in oracle regexp_like(entered
> date,'[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}','i')
>
> for postgres i have regexp_matches ,But i need how to match [:digit:] in
> postgres when we pass date..?
> any help

\d

per:
http://www.postgresql.org/docs/devel/static/functions-matching.html

# select 1 where '1234-56-78' ~ '\d{4}-\d{2}-\d{2}';
?column?
----------
1
(1 row)

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Chris Mair 2015-07-09 16:51:05 Re: regexp_matches for digit
Previous Message Andy Colson 2015-07-09 16:46:50 Index Only Scan vs Cache