Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [209.114.166.2]) by hub.org (8.9.3/8.9.3) with ESMTP id SAA34709 for ; Thu, 2 Dec 1999 18:06:49 -0500 (EST) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id SAA29402; Thu, 2 Dec 1999 18:05:02 -0500 (EST) To: kaiq@realtyideas.com cc: Tom Techoueyres , pgsql-sql@postgreSQL.org Subject: Re: [SQL] A search SQL query In-reply-to: Your message of Thu, 2 Dec 1999 16:53:43 -0600 (CST) Date: Thu, 02 Dec 1999 18:05:02 -0500 Message-ID: <29400.944175902@sss.pgh.pa.us> From: Tom Lane writes: > seems we'll fall below the bottom line: even regular expression can not > work here. Since "-" can be anywhere, no easy way out. Sure you can do it with a regular expression ... it's ugly but you can do it: where partno ~ 'L-?M-?7-?4-?1-?C-?N-?S-?G-?S' or possibly where partno ~ 'L-*M-*7-*4-*1-*C-*N-*S-*G-*S' if you need to allow multiple consecutive dashes. '-?' means 0 or 1 dash, '-*' means 0 or more dashes... regards, tom lane