this post was submitted on 30 Aug 2023
1 points (100.0% liked)

KDE

5238 readers
202 users here now

KDE is an international technology team creating user-friendly free and open source software for desktop and portable computing. KDE’s software runs on GNU/Linux, BSD and other operating systems, including Windows.

Plasma 6 Bugs

If you encounter a bug, proceed to https://bugs.kde.org, check whether it has been reported.

If it hasn't, report it yourself.

PLEASE THINK CAREFULLY BEFORE POSTING HERE.

Developers do not look for reports on social media, so they will not see it and all it does is clutter up the feed.

founded 1 year ago
MODERATORS
 

I'm trying to rename a bunch of files by removing all parenthetical from the file name EXCEPT if they contain a specific word.

For instance, say these are my files:

  • File 1 (Boop) (Ver 1).file
  • File 1 (Beep) (Ver 2).file
  • File 2 (Soup).file
  • Another File (Seep).file
  • Yet Another (Ver 5).file

I want to KEEP any parenthetical with "Ver" and a number, but I want the rest gone.

So it should look like:

  • File 1 (Ver 1).file
  • File 1 (Ver 2).file
  • File 2.file
  • Another File.file
  • Yet Another (Ver 5).file

I can write \(.*\) for Find and leave Replace blank to get rid of anything parenthetical, and it works great.

So I tried \((?!Ver).*\) and a bunch of alternatives, but it gives me the same result of just removing all parentheticals (even the ones I want). I have tried lookaheads, lookbehinds, and a bunch of syntax tweaks, but I always either end up with no parentheticals or all of them.

Any suggestions?

no comments (yet)
sorted by: hot top controversial new old
there doesn't seem to be anything here