Re: Isnumeric function? - Mailing list pgsql-sql

From Josh Berkus
Subject Re: Isnumeric function?
Date
Msg-id 200409081048.01034.josh@agliodbs.com
Whole thread Raw
In response to Re: Isnumeric function?  (Oliver Elphick <olly@lfix.co.uk>)
Responses Re: Isnumeric function?  (Oliver Elphick <olly@lfix.co.uk>)
List 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


pgsql-sql by date:

Previous
From: Oliver Elphick
Date:
Subject: Re: Isnumeric function?
Next
From: Oliver Elphick
Date:
Subject: Re: Isnumeric function?