On Sat, Dec 10, 2022 at 6:32 AM Peter J. Holzer wrote:
> On 2022-12-10 11:00:48 +, Eagna wrote:
> > > RegExp by itself cannot do this. You have to match all parts of the
> > > input into different capturing groups, then use lower() combined
> > > with format() to build a new string. Putting t
On 2022-12-10 15:37:01 +, Eagna wrote:
> Hi, and thanks for all of the input - I think I'm beginning to grok it.
I'm not so sure about that
> 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 p
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,
On 2022-12-10 "Peter J. Holzer" wrote:
> So, what's the point you are trying to make?
I suspect I mis-understood a thing you wrote… ignore me.
> > Of course all of this is dependent of locale, too.
> Right. But why would that be different for regexp_replace than for
> upper/lower?
I was tryin
On 2022-12-10 14:36:04 +, Eagna wrote:
> > I want to index on a REGEXP_REPLACE() - I thought using lower -> upper
> > would be a good test.
>
> > I could always have used another REGEXP_REPLACE() for my testing,
> > but I then became "obsessed" with the idea of using
> > REGEXP_REPLACE() as
> `select upper(x) from test`
I know about the UPPER() and LOWER() functions - I don't want them!
> If you want to do something else, please describe the actual thing you
> want to do. Not "how", but "what".
I have described it - I want to do the *_same_* thing as UPPER() does using
REGEXP_
On 2022-12-10 13:44:37 +, Gianni Ceccarelli wrote:
> On 2022-12-10 "Peter J. Holzer" wrote:
> > > * 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.
>
> Well…
>
> > select
On 2022-12-10 Eagna wrote:
> Hi again, and thanks for sticking with this.
> > You haven't explained what you're trying to accomplish.
>
> Ok.
>
> CREATE TABLE test(x TEXT);
>
> INSERT INTO test VALUES ('abc');
>
> SELECT REGEXP_REPLACE(x, '', '', 'g')
> FROM test;
>
> Expected result: AB
On 2022-12-10 "Peter J. Holzer" wrote:
> > * 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.
Well…
> select upper('ı');
┌───┐
│ upper │
├───┤
│ I │
└───┘
(1 row)
>
Hi again, and thanks for sticking with this.
> You haven't explained what you're trying to accomplish.
Ok.
CREATE TABLE test(x TEXT);
INSERT INTO test VALUES ('abc');
SELECT REGEXP_REPLACE(x, '', '', 'g') FROM test;
Expected result: ABC
See fiddle here: https://dbfiddle.uk/Q2qXXwtF
D
On 2022-12-10 11:00:48 +, Eagna wrote:
> > RegExp by itself cannot do this. You have to match all parts of the
> > input into different capturing groups, then use lower() combined
> > with format() to build a new string. Putting the capturing groups
> > into an array is the most useful option.
On 2022-12-10 10:41:41 +, Gianni Ceccarelli wrote:
> On 2022-12-10 Eagna 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 missin
On 2022-12-10 Eagna wrote:
> If you have any ideas how it could be done indirectly/different
> strategy - I'm all ears.
You haven't explained what you're trying to accomplish.
--
Dakkar -
GPG public key fingerprint = A071 E618 DD2C 5901 9574
Ciao and thanks for your input.
> * `regexp_replace` doesn't work like that, at all
> * your logic only works by accident for some languages (try to upcase
> a `ß` or a `ı`)
If you have any ideas how it could be done indirectly/different strategy - I'm
all ears.
You can assume all English c
Hi, and thanks for your input.
> RegExp by itself cannot do this. You have to match all parts of the input
> into different capturing groups, then use lower() combined with format() to
> build a new string. Putting the capturing groups into an array is the most
> useful option.
OK - I *_ki
Hi, and thanks for your input,
> 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).
This is probably why I was so frustrated - I thought that ther
On 2022-12-10 Eagna 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
* your l
Hi all,
as per the subject, I want a regular expression to do what the UPPER() function
does.
Obviously, I know about that function and it is not what I want.
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 w
On Saturday, December 10, 2022, Eagna wrote:
>
>
> Hi all,
>
>
> I want a regex to change the case of a field from UPPER to lower.
>
> I know about the UPPER() and LOWER() functions and they are not what I
> want.
>
> I would have thought this should be very simple, but I've searched a lot
> and
On 2022-12-10 09:40:22 +, 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 t
Hi all,
I want a regex to change the case of a field from UPPER to lower.
I know about the UPPER() and LOWER() functions and they are not what I want.
I would have thought this should be very simple, but I've searched a lot and
can't seem to get an answer.
Here's a fiddle with a couple of thin
21 matches
Mail list logo