X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 082699DCCF6 for ; Tue, 10 Jan 2006 11:30:53 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 23011-05-2 for ; Tue, 10 Jan 2006 11:30:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from pjetlic.mobart.hr (pjetlic.mobart.hr [80.80.51.10]) by postgresql.org (Postfix) with ESMTP id B0B059DCDC1 for ; Tue, 10 Jan 2006 10:18:43 -0400 (AST) Received: from localhost (localhost.localdomain [127.0.0.1]) by pjetlic.mobart.hr (Postfix) with ESMTP id B498B17A62 for ; Tue, 10 Jan 2006 15:18:47 +0100 (CET) Received: from pjetlic.mobart.hr ([127.0.0.1]) by localhost (pjetlic [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 04018-03-3 for ; Tue, 10 Jan 2006 15:18:47 +0100 (CET) Received: from mike.mobart.hr (mike.mobart.hr [192.168.10.94]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by pjetlic.mobart.hr (Postfix) with ESMTP id 9302817A4E for ; Tue, 10 Jan 2006 15:18:47 +0100 (CET) Subject: Regexp group matching - extracting second group element? From: Mario Splivalo Reply-To: mario.splivalo@mobart.hr To: pgsql-sql@postgresql.org Content-Type: text/plain Organization: Mob-Art Date: Tue, 10 Jan 2006 15:18:47 +0100 Message-Id: <1136902727.27803.3.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.4.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by OpenSource AV+AS Mail Server X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.053 required=5 tests=[AWL=0.053] X-Spam-Score: 0.053 X-Spam-Level: X-Archive-Number: 200601/40 X-Sequence-Number: 23829 When doing group regexp matching, I can extract first group element, using SUBSTR function, like this: octopussy2=# select substring('wizzgame auction 24' from '\\W*(\\w*)[\ \s]+(.*)'); substring ----------- wizzgame (1 row) So, i got 'wizzgame' as first group. Is there a way to extract 'auction 24' as a second group? Mario -- Mario Splivalo Mob-Art mario.splivalo@mobart.hr "I can do it quick, I can do it cheap, I can do it well. Pick any two."