Received: from copycat.mozcom.com ([205.136.46.9]) by hub.org (8.9.2/8.9.1) with ESMTP id NAA81479 for ; Sun, 28 Mar 1999 13:59:24 -0500 (EST) (envelope-from richip@mozcom.com) Received: from jaguar (jaguar.mozcom.com [202.47.132.75]) by copycat.mozcom.com (8.9.3/8.9.3) with ESMTP id CAA13371; Mon, 29 Mar 1999 02:56:04 +0800 (HKT) Date: Mon, 29 Mar 1999 02:56:04 +0800 (JST) From: Richi Plana To: Herouth Maoz cc: pgsql-sql@postgreSQL.org Subject: Re: [GENERAL] Determining if "in a text set" In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, On Sun, 28 Mar 1999, Herouth Maoz wrote: |o| perl's concept of word boundaries. But if the phrase is supposed to contain |o| just spaces (ascii 32, if you will) as word separators, I'd match against |o| the field with a space on the left and nothing on the right, a space on the |o| right and nothing on the left, spaces on both sides, or standing alone: |o| |o| SELECT * FROM {class} |o| WHERE '{phrase}' ~ ' ' || ( rtrim( FieldN ) || '$' ) |o| OR '{phrase}' ~ '^' || ( rtrim( FieldN ) || ' ' ) |o| OR '{phrase}' ~ ' ' || ( rtrim( FieldN ) || ' ' ) |o| OR '{phrase}' = rtrim( FieldN ); 1) I'm not sure the regex thing is ANSI SQL and would port to other SQL systems easilly 2) Isn't there a way to do [^{ws}](word)[{ws}$], where [^{ws}] means either the start or a whitespace and [{ws}$] means either a whitespace or EOL? 3) When I try the concat strings operator (||), I get the following psql error: ERROR: parser: syntax error at or near "||" What am I doing wrong? (I'm using PostgreSQL 6.4.2 on Sparc/Solaris with GCC compiler) There's something wrong with the concat operator on my system. I get diff. results from the ff. commands: SELECT * FROM {class} where 'MON' = FieldN; and SELECT * FROM {class} where 'MO' || 'N' = fieldN; Anybody have a clue. L L Richi Plana 8^) ,-,-. ,-,-. ,-,-. ,-,-. ,- LL LL Systems Administrator / / \ \ / / \ \ / / \ \ / / \ \ / / LLLLL Mosaic Communications, Inc. \ \ / / \ \ / / \ \ / / \ \ / / LLLLL mailto:richip@mozcom.com `-'-' `-'-' `-'-' `-'-' ------------------------------------------------------------------------ P G P Key available at http://www2.mozcom.com/~richip/richip.asc Tired of Spam? Join this CAUCE! http://www.cauce.org/