Re: Isnumeric function?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: olly(at)lfix(dot)co(dot)uk
Cc: Theo Galanakis <Theo(dot)Galanakis(at)lonelyplanet(dot)com(dot)au>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Isnumeric function?
Date: 2004-09-08 17:48:01
Message-ID: 200409081048.01034.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Theo, Oliver,

> Any reason why you don't like ~ '^([0-9]?)+\.?[0-9]*$' ?

Yes, because it also matches "." , which is not a valid numeric value.

> ~ '^([0-9]+|[0-9]+\\.[0-9]*|[0-9]*\\.[0-9]+)$'

Ah, the brute force approach ;-)

Actually, the above could be written:

~ '^([0-9]+)|([0-9]*\\.[0-9]+)$'

... though that still seems inelegant to me. Is there a regex expert in the
house?

--
Josh Berkus
Aglio Database Solutions
San Francisco

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Oliver Elphick 2004-09-08 18:11:51 Re: Isnumeric function?
Previous Message Oliver Elphick 2004-09-08 17:20:17 Re: Isnumeric function?