Re: Isnumeric function?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Isnumeric function?
Дата
Msg-id 200409081048.01034.josh@agliodbs.com
обсуждение исходный текст
Ответ на Re: Isnumeric function?  (Oliver Elphick <olly@lfix.co.uk>)
Ответы Re: Isnumeric function?
Список 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 по дате отправления:

Предыдущее
От: Oliver Elphick
Дата:
Сообщение: Re: Isnumeric function?
Следующее
От: Oliver Elphick
Дата:
Сообщение: Re: Isnumeric function?