Re: regular expression

From: Gnanavel S <s(dot)gnanavel(at)gmail(dot)com>
To: "gurkan(at)resolution(dot)com" <gurkan(at)resolution(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: regular expression
Date: 2005-10-05 04:56:58
Message-ID: eec3b03c0510042156u3c45b280h9fcb01617ca693d6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Try this,
select substring('6768 - THY','[0-9]*');
substring
-----------
6768
(1 row)

On 10/4/05, gurkan(at)resolution(dot)com <gurkan(at)resolution(dot)com> wrote:
>
> How do I do regular expression for the problem that I am having
> I have a string called desc, and say that this string in
>
> "TSWUU" ------ ""
> "4 - DSC" ------ "4"
> "6768 - THY" ------ "6768"
>
> basically string may or may not start with number,
> I need substring of digits parts
> ""
> "4"
> "6768"
>
> -------------------------------------------------
> This mail sent through IMP: www.resolution.com <http://www.resolution.com>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>

--
with regards,
S.Gnanavel

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Michael Fuhr 2005-10-05 05:56:05 Re: regular expression
Previous Message Jim Buttafuoco 2005-10-05 01:01:12 Re: using pg_tables and tablename in queries