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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-general by date

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