Received: from maia.hub.org (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 8DF536357CF for ; Wed, 3 Feb 2010 07:38:50 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 71942-10 for ; Wed, 3 Feb 2010 11:38:33 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from forward14.mail.yandex.net (forward14.mail.yandex.net [95.108.130.92]) by mail.postgresql.org (Postfix) with ESMTP id CF8CE634AA7 for ; Wed, 3 Feb 2010 07:38:39 -0400 (AST) Received: from webmail115.yandex.ru (webmail115.yandex.ru [95.108.131.136]) by forward14.mail.yandex.net (Yandex) with ESMTP id A0605268071E; Wed, 3 Feb 2010 14:38:36 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1265197116; bh=Mw73t2M2YQlOkzhkwC8kZ6zR6IUzHbtk+s3b58xsrrs=; h=From:To:Cc:In-Reply-To:References:Subject:MIME-Version:Message-Id: Date:Content-Transfer-Encoding:Content-Type; b=LmxXV6LMmms4ebUTeTOqTm8qstpR71p4QIWBveSOe4XIep7/Q0m8y7wwOBh11/fHl FS2ZNn/aD8pjMXWRC57yncVNv4w725OoMoV3DplxRPv0BJQNwRsyo9j8TZqa9cFVeI 4DoGBS/wYQPay2XzF2zoCImNnhYNQbBIYCiI3tUs= Received: from localhost (localhost.localdomain [127.0.0.1]) by webmail115.yandex.ru (Yandex) with ESMTP id 7E54C3378085; Wed, 3 Feb 2010 14:38:36 +0300 (MSK) X-Yandex-Spam: 1 X-Yandex-Front: webmail115 X-Yandex-TimeMark: 1265197116 Received: from t04-01.opera-mini.net (t04-01.opera-mini.net [94.246.126.64]) by mail.yandex.ru with HTTP; Wed, 03 Feb 2010 14:38:35 +0300 From: msi77 To: Tena Sakai Cc: pgsql-sql@postgresql.org In-Reply-To: References: Subject: Re: please help me on regular expression MIME-Version: 1.0 Message-Id: <21331265197116@webmail115.yandex.ru> Date: Wed, 03 Feb 2010 14:38:36 +0300 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=koi8-r X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=-10 required=5 tests=BAYES_50=0.001 X-Spam-Level: X-Archive-Number: 201002/25 X-Sequence-Number: 33624 Why not to use select subjectid, height from tsakai.pheno where height like '%.%'; ? > Hi everybody, > I need a bit of help on postgres reqular expression. > With a table of the following definition: > Table "tsakai.pheno" > Column | Type | Modifiers > -----------+-------------------+----------- > subjectid | integer | not null > height | character varying | not null > race | character varying | not null > blood | character varying | not null > I want to catch entries in height column that includes a > decimal point. Here's my attempt: > select subjectid, height > from tsakai.pheno > where height ~ '[:digit:]+.[:digit:]+'; > Which returns 0 rows, but if I get rid of where clause, > I get rows like: > subjectid | height > -----------+-------- > 55379 | 70.5 > 55383 | 69 > 55395 | 70 > 56173 | 71 > 56177 | 65.5 > 56178 | 70 > . . > . . > And when I escape that dot after first plus sign with a backslash, > like this: > where height ~ '[:digit:]+\.[:digit:]+'; > then I get complaint: > WARNING: nonstandard use of escape in a string literal > LINE 3: where height ~ '[:digit:]+\.[:digit:]+'; > ^ > HINT: Use the escape string syntax for escapes, e.g., E'\r\n'. > From there, it was a downward spiral descent... > Please help. > Thank you. > Regards, > Tena Sakai > tsakai@gallo.ucsf.edu > Здесь спама нет http://mail.yandex.ru/nospam/sign