• Login
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.
  • B
    Blake Kline
    last edited by Oct 31, 2022, 1:10 PM

    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?

    A 1 Reply Last reply Oct 31, 2022, 1:28 PM Reply Quote 0
    • A
      Alan Kilborn @Blake Kline
      last edited by Oct 31, 2022, 1:28 PM

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

      Any ideas?

      Just ONE.

      1 Reply Last reply Reply Quote 2
      • G
        guy038
        last edited by guy038 Oct 31, 2022, 3:52 PM Oct 31, 2022, 3:50 PM

        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

        E 1 Reply Last reply Oct 31, 2022, 4:08 PM Reply Quote 3
        • E
          Ekopalypse @guy038
          last edited by Oct 31, 2022, 4:08 PM

          @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.

          A 1 Reply Last reply Oct 31, 2022, 5:37 PM Reply Quote 2
          • A
            Alan Kilborn @Ekopalypse
            last edited by Oct 31, 2022, 5:37 PM

            @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.

            E 1 Reply Last reply Nov 1, 2022, 7:35 AM Reply Quote 1
            • E
              Ekopalypse @Alan Kilborn
              last edited by Nov 1, 2022, 7:35 AM

              @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.

              P 1 Reply Last reply Nov 1, 2022, 1:04 PM Reply Quote 0
              • P
                PeterJones @Ekopalypse
                last edited by PeterJones Nov 1, 2022, 3:53 PM Nov 1, 2022, 1:04 PM

                @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.

                E 1 Reply Last reply Nov 2, 2022, 7:04 AM Reply Quote 2
                • E
                  Ekopalypse @PeterJones
                  last edited by Nov 2, 2022, 7:04 AM

                  @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
                  • K
                    kathie carolina
                    last edited by Dec 5, 2022, 10:34 AM

                    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