X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id ED714DA11F for ; Wed, 5 Oct 2005 01:57:02 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 30405-01 for ; Wed, 5 Oct 2005 04:56:58 +0000 (GMT) Received: from zproxy.gmail.com (zproxy.gmail.com [64.233.162.205]) by svr1.postgresql.org (Postfix) with ESMTP id 02EC2DA144 for ; Wed, 5 Oct 2005 01:56:58 -0300 (ADT) Received: by zproxy.gmail.com with SMTP id j2so46591nzf for ; Tue, 04 Oct 2005 21:56:58 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:reply-to:to:subject:cc:in-reply-to:mime-version:content-type:references; b=kKSgCpTkcVHqBGDYdwp51tLqcHANAbwSX+vDGbPRufDwJzGOcs68gwA3wishJKT4MFImLOc3pCjmwsqEwqURSNnBuxOjm50yAqNlvGMmuuXVkTZPXrIpbaQ5sjKtb7rRZfipK07ex+SNAFhCfMYyZnkphFFETUnwZ7/okez0oOU= Received: by 10.36.49.12 with SMTP id w12mr215914nzw; Tue, 04 Oct 2005 21:56:58 -0700 (PDT) Received: by 10.36.120.14 with HTTP; Tue, 4 Oct 2005 21:56:58 -0700 (PDT) Message-ID: Date: Wed, 5 Oct 2005 10:26:58 +0530 From: Gnanavel S Reply-To: Gnanavel S To: "gurkan@resolution.com" Subject: Re: regular expression Cc: pgsql-sql@postgresql.org In-Reply-To: <1128377310.4341abde55776@www.resolution.com> MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_19496_19443609.1128488218545" References: <1128377310.4341abde55776@www.resolution.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.498 required=5 tests=[AWL=-0.092, HTML_50_60=0.095, HTML_MESSAGE=0.001, RCVD_BY_IP=0.024, TO_ADDRESS_EQ_REAL=0.47] X-Spam-Level: X-Archive-Number: 200510/25 X-Sequence-Number: 22878 ------=_Part_19496_19443609.1128488218545 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Try this, select substring('6768 - THY','[0-9]*'); substring ----------- 6768 (1 row) On 10/4/05, gurkan@resolution.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 > > ---------------------------(end of broadcast)--------------------------- > TIP 2: Don't 'kill -9' the postmaster > -- with regards, S.Gnanavel ------=_Part_19496_19443609.1128488218545 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Try this,
select substring('6768 - THY','[0-9]*');
 substring
-----------
 6768
(1 row)

On 10/4/05, gurkan@resolution.c= om <gurkan@resolution.c= om > 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"        &n= bsp; ------ ""
"4 - DSC"    = ;    ------ "4"
"6768 - THY"&nbs= p;    ------ "6768"

basically string may o= r may not start with number,
I need substring of digits parts
""
"4"
"= 6768"

-------------------------------------------------
This= mail sent through IMP: www.resolutio= n.com

---------------------------(end of broadcast)------------------= ---------
TIP 2: Don't 'kill -9' the postmaster


--
with regards,
S.Gnanavel ------=_Part_19496_19443609.1128488218545--