X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 37D80D1E74F for ; Fri, 30 Apr 2004 13:26:30 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 60785-02 for ; Fri, 30 Apr 2004 13:26:09 -0300 (ADT) Received: from tomts25-srv.bellnexxia.net (tomts25-srv.bellnexxia.net [209.226.175.188]) by svr1.postgresql.org (Postfix) with ESMTP id 9A2C5D1E8B1 for ; Fri, 30 Apr 2004 13:26:07 -0300 (ADT) Received: from acer.sympatico.ca ([65.95.177.252]) by tomts25-srv.bellnexxia.net (InterMail vM.5.01.06.05 201-253-122-130-105-20030824) with ESMTP id <20040430162547.VYME4905.tomts25-srv.bellnexxia.net@acer.sympatico.ca> for ; Fri, 30 Apr 2004 12:25:47 -0400 Message-Id: <5.2.1.1.0.20040430121848.02a4cda0@pop6.sympatico.ca> X-Sender: b1wudu74@pop6.sympatico.ca X-Mailer: QUALCOMM Windows Eudora Version 5.2.1 Date: Fri, 30 Apr 2004 12:24:03 -0400 To: From: Frank Bax Subject: Re: isnumeric() function? In-Reply-To: <003601c42ec7$e7806ee0$8401a8c0@home.axiontech.com> References: <20040430141145.40776.qmail@web20809.mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=0.2 tagged_above=0.0 required=5.0 tests=RCVD_IN_NJABL, RCVD_IN_SORBS X-Spam-Level: X-Archive-Number: 200404/338 X-Sequence-Number: 17713 At 11:29 AM 4/30/04, Yudie wrote: >Great the function works, but what does it means? >SELECT $1 ~ ''^[0-9]+$'' > >Yudie The ~ is a pattern matching operator. ^ matches beginning of string [0-9] matches any numeric digit 0 thru 9. + matches one or more occurrences of what came before (digits in this case) $ matches end of string The ^ and $ are important - if they were left out, the pattern would match a string containing both numeric and non-numeric data. You can change the + to * if you decide that an empty string should be considered numeric. Frank