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 54F54D8070 for ; Wed, 12 Oct 2005 18:03:46 -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 31299-10 for ; Wed, 12 Oct 2005 21:03:37 +0000 (GMT) Received: from tigger.fuhr.org (tigger.fuhr.org [63.214.45.158]) by svr1.postgresql.org (Postfix) with ESMTP id 5FA59D805D for ; Wed, 12 Oct 2005 18:03:38 -0300 (ADT) Received: from winnie.fuhr.org (winnie.fuhr.org [10.1.0.1]) by tigger.fuhr.org (8.13.3/8.13.3) with ESMTP id j9CL3bps085089 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 12 Oct 2005 15:03:40 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: from winnie.fuhr.org (localhost [127.0.0.1]) by winnie.fuhr.org (8.13.4/8.13.4) with ESMTP id j9CL3btI051125; Wed, 12 Oct 2005 15:03:37 -0600 (MDT) (envelope-from mfuhr@winnie.fuhr.org) Received: (from mfuhr@localhost) by winnie.fuhr.org (8.13.4/8.13.4/Submit) id j9CL3b35051124; Wed, 12 Oct 2005 15:03:37 -0600 (MDT) (envelope-from mfuhr) Date: Wed, 12 Oct 2005 15:03:37 -0600 From: Michael Fuhr To: gurkan@resolution.com Cc: pgsql-sql@postgresql.org Subject: Re: regular expression Message-ID: <20051012210337.GA50999@winnie.fuhr.org> Reply-To: pgsql-sql@postgresql.org References: <1129148927.434d71ffc0e13@www.resolution.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1129148927.434d71ffc0e13@www.resolution.com> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.006 required=5 tests=[AWL=0.006] X-Spam-Level: X-Archive-Number: 200510/106 X-Sequence-Number: 22959 [Please copy the mailing list on replies.] On Wed, Oct 12, 2005 at 04:28:47PM -0400, gurkan@resolution.com wrote: > Thanks for the reply. It helped a lot. I was goint to ask similar question > regarding regular expression, but this time I need not the numeric part. What I > mean is; > say that this may be in these format > "TSWUU" ---need--- "TSWUU" > "4 - DSC" ---need--- "DSC" > "6768 - THY" ---need--- "THY" > basically string may or may not start with number, > I need substring of character if it starts with number discard it This isn't a PostgreSQL issue, but rather one of understanding how regular expressions work in general. See the previously mentioned "Pattern Matching" section of the PostgreSQL documentation for the PostgreSQL-specific details, and use a search engine to find a regular expression tutorial; they're frequently used in Perl and other languages so a lot of learning material exists. If you can find a copy in a library or bookstore, the book _Mastering Regular Expressions_ by Jeffrey E. F. Friedl, published by O'Reilly, is a good resource. -- Michael Fuhr