Skip site navigation (1) Skip section navigation (2)

Substring RegExp Extract path

From: nicholas(dot)wakefield(at)gmail(dot)com (Nick)
To: pgsql-general(at)postgresql(dot)org
Subject: Substring RegExp Extract path
Date: 2004-08-25 03:02:16
Message-ID: b065e608.0408241902.512449e9@posting.google.com (view raw or flat)
Thread:
Lists: pgsql-general
Hi,

I'm trying to extract element of a directory path stored in the db with substring

"/help/support/index/time.jsp"

and i want to extract the 1st, 2nd and 3rd parts

1st = help, 2nd = support, 3rd = index

but I can't get the regular expressions correct.

Any ideas on what I need to do.

select substring(data,'????') from paths

TIA

Responses

pgsql-general by date

Next:From: Carlos MorenoDate: 2004-08-25 04:14:56
Subject: Re: Deadlocks caused by referential integrity checks
Previous:From: Tatsuo IshiiDate: 2004-08-25 02:21:32
Subject: Re: UTF-8 and LIKE vs =

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group