Re: regexp_matches for digit

From: Ramesh T <rameshparnanditech(at)gmail(dot)com>
To: Chris Mair <chris(at)1006(dot)org>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: regexp_matches for digit
Date: 2015-07-09 17:17:58
Message-ID: CAK8Zd=v4d_qn_vmJx4_pPVF3fW1jW0nnECnDdtSYk__oz+9xBA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

nice i'm looking for this,i thought digit don't work in postgres..
thanks

On Thu, Jul 9, 2015 at 10:21 PM, Chris Mair <chris(at)1006(dot)org> 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
>
> [:digit:] is Posix syntax, supported by Postgres.
>
> Looks good to me:
>
> graal=# select regexp_matches('2015-07-09',
> '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}','i');
> regexp_matches
> ----------------
> {2015-07-09}
> (1 row)
>
> graal=# select regexp_matches('2015-x7-09',
> '[[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2}','i');
> regexp_matches
> ----------------
> (0 rows)
>
> What do you need, exactly?
>
> Bye,
> Chris.
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2015-07-09 17:41:57 Re: Index Only Scan vs Cache
Previous Message Steve Crawford 2015-07-09 17:05:01 Re: regexp_matches for digit