Community
    • Login

    Replace all the "Square Brackets"

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    5 Posts 3 Posters 1.8k 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.
    • Rumi BalkhiR
      Rumi Balkhi
      last edited by

      Hi,

      I am editing a very big file of +1000 pages. I have thousands of Square Brackets [] which contains informative text that I don’t need anymore. So, I want to delete all the square brackets and anything inside it. Example below

      This is a [01] dummy text [02]. This [03] is dummy [04] text. This [05] is dummy [06] text. This is a [abc] dummy text [abc]. This [abc] is dummy [abc] text. This [abc] is dummy [abc] text.

      To

      This is a dummy text. This is dummy text. This is dummy text. This is a dummy text. This is dummy text. This is dummy text.

      Please Help.
      Thanks in Advance

      Terry RT PeterJonesP 2 Replies Last reply Reply Quote 0
      • Terry RT
        Terry R @Rumi Balkhi
        last edited by

        @Rumi-Balkhi said in Replace all the "Square Brackets":

        So, I want to delete all the square brackets and anything inside it.

        Firstly I see you have been a member on this forum for 4 years or so. On one of your previous requests for help you were shown links on where to locate documentation that would help you understand regular expressions and learn it. So what have you done in the intermediate period? Have you tried anything to solve this question? If so how about showing it to us.

        It was explained back then that this is not a service to fix all your problems and after a few solutions are provided we generally expect you to have at least tried to understand and attempt to find a solution yourself, so learning.

        If you have no intention of learning then I’m not so inclined to help. Maybe others might be more forgiving.

        Terry

        PS this is quite a simple regular expression. In fact if you even tried to search through the post I have great expectation you would probably find the exact answer or something very similar that even you could alter to suit your request. I will even explain it:

        1. find (and capture) a left square bracket.
        2. capture any characters following until I see a right square bracket.
        3. capture the right square bracket.
        4. Using the Replace function with an empty Replace With field so it removes the captured characters.
        Rumi BalkhiR 1 Reply Last reply Reply Quote 1
        • PeterJonesP
          PeterJones @Rumi Balkhi
          last edited by

          @Rumi-Balkhi ,

          Pursuant to what @Terry-R pointed out, if you cannot remember the links to the docs (and since the docs have changed a lot in the last 4 years), please see this updated list.

          Terry gave you a step-by-step list of what needs to be in the search expression. And the documents listed below will help you translate those steps into the appropriate syntax for the search expression.

          ----

          Useful References

          • Please Read Before Posting
          • Template for Search/Replace Questions
          • FAQ: Where to find regular expressions (regex) documentation
          • Notepad++ Online User Manual: Searching/Regex
          Rumi BalkhiR 1 Reply Last reply Reply Quote 1
          • Rumi BalkhiR
            Rumi Balkhi @Terry R
            last edited by

            Dear @Terry-R,

            I appreciate your reply. But please bear in mind that most of the people have no knowledge of coding or computer. They have less than 1% of knowledge in coding.

            If you don’t like the tread, just ignore it but don’t disrespect people based on their questions.

            The question might look silly to you but for some people, it is a hard one. Anyways.

            Regards

            1 Reply Last reply Reply Quote 0
            • Rumi BalkhiR
              Rumi Balkhi @PeterJones
              last edited by

              @PeterJones Thanks, I will go through the documentations once again. Thanks for understanding though.

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