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

Поиск
Список
Период
Сортировка
От Eagna
Тема Re: Regular expression to UPPER() a lower case string
Дата
Msg-id fgSp5K7HkX69er-G42suxcBE5nMS-AWqj3TtGKyF7Tgof4dlO0Q6YWDJScuagN2G2mJXydpYmTwWPpxpdMEWmkoQ1hTUaDVEyDEsW7SPgsQ=@protonmail.com
обсуждение исходный текст
Ответ на Re: Regular expression to UPPER() a lower case string  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Ответы Re: Regular expression to UPPER() a lower case string  ("Peter J. Holzer" <hjp-pgsql@hjp.at>)
Список pgsql-general
Hi, and thanks for all of the input - I think I'm beginning to grok it.

> On second thought you could probably use NFD normalization to separate
> base letters from accents, uppercase the base letters and then
> (optionally) NFC normalize everything again. Still insane ;-).

As far as I can see, I can only do what I want by using the following.

If there's a monthly prize on this list for the most insanely contrived piece of code, I think this is a strong
contender:

test.x = 'abc'

SELECT
  UPPER(REGEXP_REPLACE(x, '(.)(.)(.)', '\1')) ||
  UPPER(REGEXP_REPLACE(x, '(.)(.)(.)', '\2')) ||
  UPPER(REGEXP_REPLACE(x, '(.)(.)(.)', '\3'))
FROM test;

Result: ABC

(see https://dbfiddle.uk/LQ-6udga).

Still a bit of work to do, but I'm getting there :-)

E.


> hp




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

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