X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 36DE59FB0D1 for ; Fri, 7 Jul 2006 11:12:57 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 03615-03 for ; Fri, 7 Jul 2006 11:12:52 -0300 (ADT) X-Greylist: delayed 00:19:36.333007 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id E4C3C9FB1F3 for ; Fri, 7 Jul 2006 11:12:51 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from dougal.cranntara.net (unknown [217.112.91.201]) by svr4.postgresql.org (Postfix) with ESMTP id 48A335AF089 for ; Fri, 7 Jul 2006 13:53:14 +0000 (GMT) Received: from host217-32-132-96.webport.bt.net ([217.32.132.96] helo=bolek.coachhouse) by dougal.cranntara.net with asmtp (Exim 3.36 #1 (Debian)) id 1Fyqms-0003Mv-00 for ; Fri, 07 Jul 2006 14:54:31 +0100 Received: (Exim 3.36) #1 (Debian)) protocol: esmtp id 1Fyqjx-000503-00 ; Fri, 07 Jul 2006 14:51:29 +0100 Message-ID: <44AE66E0.1040606@numerixtechnology.de> Date: Fri, 07 Jul 2006 14:51:28 +0100 From: T E Schmitz Reply-To: mailreg@numerixtechnology.de User-Agent: Debian Thunderbird 1.0.7 (X11/20051017) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: SELECT substring with regex Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/99 X-Sequence-Number: 25673 I would like to split the contents of a column using substring with a regular expression: SELECT substring (NAME, '^\\d+mm') as BASE_NAME, substring (NAME, ??? ) as SUFFIX FROM MODEL The column contains something like "150mm LD AD Asp XR Macro" I want to split this into "150mm", "LD AD Asp XR Macro" How can I extract the bit following the matching substring? -- Regards, Tarlika Elisabeth Schmitz