Re: reverse strpos? - Mailing list pgsql-general

From hubert depesz lubaczewski
Subject Re: reverse strpos?
Date
Msg-id 20071112202524.GA26692@depesz.com
Whole thread Raw
In response to reverse strpos?  ("Gauthier, Dave" <dave.gauthier@intel.com>)
List pgsql-general
On Mon, Nov 12, 2007 at 10:54:53AM -0500, Gauthier, Dave wrote:
> Is there a function that'll return the position of the last occurance of
> a char in a string?
> For Example, in the string 'abc/def/ghi' I want the position of the 2nd
> '/'.

# select length(substring('abc/def/ghi' from '^(.*/)'));
 length
--------
      8
(1 row)

depesz

--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA.  here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)

pgsql-general by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: WAL segments size
Next
From: Andrew Dunstan
Date:
Subject: Re: [HACKERS] plperl and regexps with accented characters - incompatible?