1

I'm trying to clean up this file a bit and get rid of useless lines with notepad++. I know there was an easy way to do this but I forgot how.

Basically I want to search and remove all groups associated with (- Default) such as below. I want to remove every uui/options/name/group/permissions basically any player data that is in the group (- Default) but Its not easy with the "replace" option as you can see every player has a different name or uuid and its hard to remove in bulk since the file has over 104k lines.

  • I remember it had to do with Mark options in the notepad++ *

    -> Remove       00126374-2f71-438b-b30b-2aad7da6c169:
    -> Remove     options:
    -> Remove       name: NightCorePvP
    -> Remove     group:
    -> Remove     - Default <- (Keyword)
    -> Remove     permissions:
    -> Remove     - none
    
      003fdb5d-b980-4761-88c8-34f0d7478755:
        options:
          name: XanderCole
        group:
        - iron
        permissions:
        - none
      0006597c-625e-4e85-a0d9-fa125f44ad5d:
        options:
          name: JugendLammy
        group:
        - Default
        permissions:
        - none  008604cc-1e71-419a-b1c9-fd79e53cabc6:
    

Here is an image of the file as an example on what to keep and remove - https://i.gyazo.com/4621d7151dbeb25a1855ffbd03f81e7d.png

Cœur
  • 32,421
  • 21
  • 173
  • 232

1 Answers1

1

Try this find and replacement of an entire target matching group. The trick here is to match an entire group, regardless of the field values, as long as the group is default.

Find:

\s*\w{8}-\w{4}-\w{4}-\w{4}-\w{12}:\n
\s*options:\n
\s*name: \w+\n
\s*group:\n
\s*- Default\n
\s*permissions:\n
.*\n

Replace:

(nothing)
Tim Biegeleisen
  • 387,723
  • 20
  • 200
  • 263