Community
    • Login

    Replace symbols around a word

    Scheduled Pinned Locked Moved General Discussion
    9 Posts 6 Posters 727 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.
    • Blake KlineB
      Blake Kline
      last edited by

      I’m trying to replace a lot of lines that would otherwise take so much time.

      From:
      [[Wood]] [[Unit|units]]

      To:
      {{LT2|Wood}} {{LT2|Unit|units}}

      Any ideas?

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Blake Kline
        last edited by

        @Blake-Kline said in Replace symbols around a word:

        Any ideas?

        Just ONE.

        1 Reply Last reply Reply Quote 2
        • guy038G
          guy038
          last edited by guy038

          Hello, @blake-kline, @alan-kilborn and All,

          @blake-kline, if the text shown in your post, just represents the present and future text, the following regex S/R should modify your text as expected !

          • SEARCH (?x-i) \x5B\x5B ( Wood ) \x5D \x5D \x20 \x5B\x5B ( Unit \| units ) \x5D\x5D

          • REPLACE {{LT2|\1}} {{LT2|\2}}

          Best Regards,

          guy038

          EkopalypseE 1 Reply Last reply Reply Quote 3
          • EkopalypseE
            Ekopalypse @guy038
            last edited by

            @guy038
            I’m not sure if I’m missing something, but if the text OP provided is exactly the text that should be changed, wouldn’t that be the obvious solution:

            find: [[Wood]] [[Unit|units]]
            replace: {{LT2|Wood}} {{LT2|Unit|units}}

            No regex is needed at all.

            Alan KilbornA 1 Reply Last reply Reply Quote 2
            • Alan KilbornA
              Alan Kilborn @Ekopalypse
              last edited by

              @Ekopalypse said in Replace symbols around a word:

              No regex is needed at all.

              Well, that’s the reason I suspected the OP just hasn’t asked their true question, and thus why I directed them to information on how they should ask their question.

              EkopalypseE 1 Reply Last reply Reply Quote 1
              • EkopalypseE
                Ekopalypse @Alan Kilborn
                last edited by

                @Alan-Kilborn
                That’s how I interpreted it, yes, but OP upgraded @guy038’s response, so we both seem to have missed something Guy (?) understood. OP seems happy - that’s what matters.

                PeterJonesP 1 Reply Last reply Reply Quote 0
                • PeterJonesP
                  PeterJones @Ekopalypse
                  last edited by PeterJones

                  @Ekopalypse said in Replace symbols around a word:

                  That’s how I interpreted it, yes, but OP upgraded @guy038’s response, so we both seem to have missed something Guy (?) understood.

                  And oddly, when I was thinking up my reply in case it was needed (and it obviously wasn’t), mine was going to be even more generic than Guy’s answer, replacing anything between double-brackets with double-braces-and-LT2 (and wasn’t restricted to always two-to-a-line). So I was surprised when the OP seemed to be happy with Guy’s less-generic expression.

                  This is why it’s better the more details a person includes in their original question, because there were at least three reasonable (but incompatible) interpretations of the original question in this case. And it’s such vagueness that gives the Search-and-Replace-Question-Template a reason to exist.

                  EkopalypseE 1 Reply Last reply Reply Quote 2
                  • EkopalypseE
                    Ekopalypse @PeterJones
                    last edited by

                    @PeterJones said in Replace symbols around a word:

                    This is why it’s better the more details a person includes in their original question…

                    I couldn’t agree more.

                    1 Reply Last reply Reply Quote 0
                    • kathie carolinaK
                      kathie carolina
                      last edited by

                      Replacing symbols is very simple if you use Facebook symbols. I learned a lot from this website, which has a great article on each symbol. You can convert your whole article into a symbol if you have knowledge about it.

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