• Login
Community
  • Login

Deleting Sections

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 3 Posters 757 Views
Loading More Posts
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B
    Berkan
    last edited by Berkan Dec 1, 2022, 2:03 PM Dec 1, 2022, 2:02 PM

    How can I replace them all

    can_upgrade_trigger = {
    OR = {
    culture = roman
    religion_group = pagan
    }
    }

    with the one below.

    can_upgrade_trigger = {
    }

    There are many and everyone has a different kind of text in it. Just want to empty every one of them.

    P 1 Reply Last reply Dec 1, 2022, 2:11 PM Reply Quote 0
    • P
      PeterJones @Berkan
      last edited by Dec 1, 2022, 2:11 PM

      @Berkan ,

      What is the “uniqueness” that will determine whether or not the contents get emptied? Is it "all containers that start with can_upgrade_trigger = ? Is it “all outermost containers”? Is it something else that I cannot guess? Because all of those have a different answer.

      Useful References

      • Please Read Before Posting
      • Template for Search/Replace Questions
      • Formatting Forum Posts
      • FAQ: Where to find regular expressions (regex) documentation
      • Notepad++ Online User Manual: Searching/Regex
      1 Reply Last reply Reply Quote 0
      • G
        guy038
        last edited by guy038 Dec 1, 2022, 2:28 PM Dec 1, 2022, 2:27 PM

        Hello, @berkan, @peerjones and All,

        From your exact INPUT text, I would use the following regex S/R :

        SEARCH (?s-i)^can_upgrade_trigger.+?\{\R\K(.+?^\}\R)

        REPLACE Leave EMPTY

        • Tick the Wrap around option

        • Select the Regular expression search mode

        • Click once ONLY on the Replace All button ( Do not use the Replace button )

        Best Regards,

        guy038

        B 1 Reply Last reply Dec 1, 2022, 8:40 PM Reply Quote 3
        • B
          Berkan @guy038
          last edited by Dec 1, 2022, 8:40 PM

          @guy038 Thank you for your help. It worked perfectly

          1 Reply Last reply Reply Quote 0
          1 out of 4
          • First post
            1/4
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors