Re: Regex escape [ character and change text result into integer

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Pratt <fairwinds(at)eastlink(dot)ca>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Regex escape [ character and change text result into integer
Date: 2005-07-05 16:22:57
Message-ID: 23620.1120580577@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Pratt <fairwinds(at)eastlink(dot)ca> writes:
> Hi. I am using array_dims to give me dimensions of multidimensional
> array ie:

> [1:5][1:2]

> In my function I want to retreive the value of the second number from
> array_dims (5 in example above)

Why aren't you using array_upper()?

> This is what I am trying:
> count_str = substr(dimensions from '\[\d\:(\d+)\]\[\d\:\d\]')

Perhaps you forgot to double the backslashes?

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jaime Casanova 2005-07-05 16:58:19 default tablespaces
Previous Message David Pratt 2005-07-05 16:01:41 Regex escape [ character and change text result into integer