Re: Regular expression to UPPER() a lower case string

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Regular expression to UPPER() a lower case string
Дата
Msg-id 20221210131346.3pqmksqk4jvnyxrm@hjp.at
обсуждение исходный текст
Ответ на Re: Regular expression to UPPER() a lower case string  (Gianni Ceccarelli <dakkar@thenautilus.net>)
Ответы Re: Regular expression to UPPER() a lower case string  (Gianni Ceccarelli <dakkar@thenautilus.net>)
Список pgsql-general
On 2022-12-10 10:41:41 +0000, Gianni Ceccarelli wrote:
> On 2022-12-10 Eagna <eagna@protonmail.com> wrote:
> > This should be very (very) easy - I don't know what I'm missing -
> > I've done quite complex regular expressions before and I don't know
> > what I'm doing wrong. Brain burping this morning!
>
> You're missing that:
>
> * `regexp_replace` doesn't work like that, at all

No it doesn't. But the equivalent operation in some other languages and
tools does, so there is no reason that it couldn't do that (of course
neither is that a reason why it should).

> * your logic only works by accident for some languages (try to upcase
>   a `ß` or a `ı`)

This is also true of upper() and lower() and SQL does provide those.

        hp

--
   _  | Peter J. Holzer    | Story must make more sense than reality.
|_|_) |                    |
| |   | hjp@hjp.at         |    -- Charles Stross, "Creative writing
__/   | http://www.hjp.at/ |       challenge!"

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Gianni Ceccarelli
Дата:
Сообщение: Re: Regular expression to UPPER() a lower case string
Следующее
От: "Peter J. Holzer"
Дата:
Сообщение: Re: Regular expression for lower case to upper case.