This forum has been archived. All content is frozen. Please use KDE Discuss instead.

KRename Regex - How does it work?

Tags: None
(comma "," separated)
User avatar
KomraDE
Registered Member
Posts
27
Karma
0
OS

KRename Regex - How does it work?

Sat Nov 26, 2022 5:59 pm
KRename is a nice and handy tool but when it comes to regular expressions, it fails me often.

The latest thing is a filename like this
Code: Select all
bla.bla.foo{{jkh7845kjhfv98}}

I want to remove the curly brackets and its contents.

On either https://regexr.com/3bvel and https://regex101.com/ the following expression does it like a charm
Code: Select all
\{.*\}


At first I thought I got it wrong but even grep in the console returns proper results with this expression, only KRename doesn't do a thing. I suspected I got it wrong on escaping but a term like
Code: Select all
\d

correctly removes all the digits.

Alas, I cannot find the curly bracket
Code: Select all
\{


Does anyone know why the curly bracket remains undetected? Who is wrong, me or KRename?

PS: Just found a solution with using it as class
Code: Select all
[{]

but it still eludes me why the escaping does not work as expected ???


Take a good look, children. It will prepare you for your adult lives in our nightmarish corporate system.


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Google [Bot], Sogou [Bot], Yahoo [Bot]