Re: Regular expression for lower case to upper case.

Поиск
Список
Период
Сортировка
От Peter J. Holzer
Тема Re: Regular expression for lower case to upper case.
Дата
Msg-id 20221210102506.bg3ogthnrzislep4@hjp.at
обсуждение исходный текст
Ответ на Regular expression for lower case to upper case.  (Eagna <eagna@protonmail.com>)
Ответы Re: Regular expression for lower case to upper case.  (Eagna <eagna@protonmail.com>)
Список pgsql-general
On 2022-12-10 09:40:22 +0000, Eagna wrote:
> I want a regex to change the case of a field from UPPER to lower.

First a note about terminology: A regular expression matches a string,
it doesn't replace anything.

The regexp_replace function uses a regular expression to match parts of
a string and then uses to replacement string to replace them - but the
replacement string is not itself a regular expresssion.

Tha said, the replacement string in some editors (like Vim) and some
programming languages (like Perl) provides syntax for changing case
(both vi(m) and Perl use \u and \U...\E for uppercasing).

https://www.postgresql.org/docs/current/functions-matching.html#FUNCTIONS-POSIX-REGEXP
doesn't mention any special escapes except \1 through \9 and \&. So it
is extremely likely that no such escapes exist.


> I know about the UPPER() and LOWER() functions and they are not what I want.

Can you elaborate why you can't use 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 по дате отправления:

Предыдущее
От: Eagna
Дата:
Сообщение: Regular expression for lower case to upper case.
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Regular expression for lower case to upper case.