Re: Looking for types: phone number, email addresses
От | Lee Kindness |
---|---|
Тема | Re: Looking for types: phone number, email addresses |
Дата | |
Msg-id | 15672.8647.762495.46482@kelvin.csl.co.uk обсуждение исходный текст |
Ответ на | Re: Looking for types: phone number, email addresses (Stephane Bortzmeyer <bortzmeyer@nic.fr>) |
Ответы |
Re: Looking for types: phone number, email addresses
|
Список | pgsql-general |
Stephane Bortzmeyer writes: > Oliver Elphick <olly@lfix.co.uk> wrote > > CHECK (phone ~ '^\\+33 [0-9]( [0-9]{2}){4}$') > > That's only good for French numbers > OK, let's check: > CHECK (phone ~ '^\\+[0-9]+[ 0-9]+$') > which is, I believe, international (although the above regexp does not > prevent strange things like two consecutive spaces). Still a loosing battle and IMO a needless constraint... For example I'd normally write my work number as '+44 (0)131 557 5595' which the above regex wouldn't grok... And it's also common in several counties for people to use '.' and '-' as separators! Is the field going to be used by humans (in which case they can sort out minor formatting issues on the fly) or for automated dialing (in which case you'd probably want to strip out everything bar numerics)? Lee.
В списке pgsql-general по дате отправления: