Received: from localhost (unknown [200.46.204.183]) by developer.postgresql.org (Postfix) with ESMTP id 968792E0083 for ; Thu, 24 Apr 2008 12:43:20 -0300 (ADT) Received: from developer.postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 71938-01 for ; Thu, 24 Apr 2008 12:43:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from dukecmmtar01.coxmail.com (dukecmmtar01.coxmail.com [68.99.120.48]) by developer.postgresql.org (Postfix) with ESMTP id D16832E0067 for ; Thu, 24 Apr 2008 12:43:16 -0300 (ADT) Received: from [127.0.0.1] (really [70.166.0.90]) by dukecmmtar01.coxmail.com (InterMail vM.6.01.06.01 201-2131-130-101-20060113) with ESMTP id <20080424154316.EHJA28132.dukecmmtar01.coxmail.com@[127.0.0.1]>; Thu, 24 Apr 2008 11:43:16 -0400 Message-ID: <4810AA95.3080609@acm.org> Date: Thu, 24 Apr 2008 08:43:17 -0700 From: TJ O'Donnell User-Agent: Thunderbird 2.0.0.12 (Windows/20080213) MIME-Version: 1.0 To: anoopmadavoor@gmail.com, PostgreSQL - SQL Subject: Re: How I can check a substring is a valid number in postgresql ? 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: 200804/169 X-Sequence-Number: 30708 This regular expression works for numeric/float values as well as integers. It allows for exponents. tvalue ~ E'^[+-]?[0-9]+(\\\\.[0-9]*)?([Ee][+-]?[0-9]+)?\$' TJ O'Donnell http://www.gnova.com/