Search Postgresql Archives

Re: regexp_matches for digit

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

 



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@xxxxxxxx> 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.




[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