Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Replace symbols around a word

    General Discussion
    6
    9
    202
    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 Kline
      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 Kilborn 1 Reply Last reply Reply Quote 0
      • Alan Kilborn
        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
        • guy038
          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

          Ekopalypse 1 Reply Last reply Reply Quote 3
          • Ekopalypse
            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 Kilborn 1 Reply Last reply Reply Quote 2
            • Alan Kilborn
              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.

              Ekopalypse 1 Reply Last reply Reply Quote 1
              • Ekopalypse
                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.

                PeterJones 1 Reply Last reply Reply Quote 0
                • PeterJones
                  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.

                  Ekopalypse 1 Reply Last reply Reply Quote 2
                  • Ekopalypse
                    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 carolina
                      kathie carolina Banned 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
                      Copyright © 2014 NodeBB Forums | Contributors