Community
    • Login

    replace some text inside the quotes

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    9 Posts 4 Posters 2.7k 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.
    • VivianjenylordV
      Vivianjenylord
      last edited by

      friends how can i replace some text inside the quotes

      “concerto” “.uk” site:usa
      “maestro” + “.mx” + site:usa

      to

      “concerto” “.usa” site:usa
      “maestro” + “.usa” + site:usa

      1 Reply Last reply Reply Quote 0
      • Makwana PrahladM
        Makwana Prahlad Banned
        last edited by

        Hello,@Vivianjenylord

        Follow this step ,To replace some text inside the quotes

        Step 1:- First make sure “Replace straight quotes with Smart quotes” is ticked, on the “AutoFormat As You Type” tab under Tools + Autocorrect; and if you want to use a highlight in the replace, make sure the default highlight colour on the Reviewing toolbar is set to the colour you want.

        Step 2:- Then replace " with ", which will replace any straight quotes in the document with smart quotes.

        Step 3:- Now do your wildcard Find and Replace.
        Your “Find What” text needs to be:
        (“)(*)(”)
        Note that the quotes must be smart quotes: you can paste them from the document into the “Find what:” box.
        Your Replace with text needs to be:
        \2
        And in the “Replace with:” box, either select Format + Font + Italic, or Format + Highlight, depending on your preference.

        Step 4:- Finally, remove any orpaned opening smart quotes “ (as you might have if you’d had a quotation spanning more than one paragraph), by replacing the opening quote character (which, as before, you can cut and paste into the dialog from the document; don’t type it) with nothing.

        I hope this information will be usefull for you.

        Thank you.

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

          Hello, @vivianjenylord,

          Your example is really too succinct. It’s impossible to come up with a valid rule.

          We need more information:

          • What is the general structure of each line?

          • What are the areas in double quotation marks, on each line, that need to be replaced ?

          • Does the replacement part have to be the same word as the one after the site: expression ?

          In other words, help us identify the problem and help you effectively !

          Best Regards,

          guy038

          VivianjenylordV 1 Reply Last reply Reply Quote 2
          • VivianjenylordV
            Vivianjenylord @guy038
            last edited by

            @guy038

            friends what I need is to change the text that is inside the quotes that have the country domains
            “.mx” to “.usa”
            “.ar” to “.usa”
            the other text that has quotation marks, those don’t, I tried with
            “[^”] + "

            WITH
            “.us”
            but change everything inside the quotes
            “Concerto” “.uk” site: use
            to
            “usa” “.usa” site: use and I don’t want that

            EkopalypseE 1 Reply Last reply Reply Quote 0
            • EkopalypseE
              Ekopalypse @Vivianjenylord
              last edited by

              @Vivianjenylord

              from the given example something like this could be the solution
              find:"\.\w+"(.*?site:)(\w+)
              replace:"\.$2"$1$2
              check regular expression in search mode

              VivianjenylordV 1 Reply Last reply Reply Quote 3
              • VivianjenylordV
                Vivianjenylord @Ekopalypse
                last edited by

                @Ekopalypse said in replace some text inside the quotes:

                “.$2”$1$2

                thank you very much friends, it worked

                thanks for interest in my problem

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

                  Hello, @vivianjenylord, @ekopalypse, and All,

                  So I was on the right track when I asked my 3rd question !

                  An alternative solution, if each line ends with the string site:...

                  SEARCH \.\w+(?=.*?:(\w+))

                  REPLACE .\1

                  Best Regards,

                  guy038

                  VivianjenylordV 1 Reply Last reply Reply Quote 2
                  • VivianjenylordV
                    Vivianjenylord @guy038
                    last edited by

                    @guy038
                    excellent my friend, thanks very much
                    great guy038

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

                      Hello, @vivianjenylord and All,

                      Some explanations on this regex S/R :

                      • The part \.\w+ searches a literal dot character, followed with a non-null range of word chars…

                      • But ONLY IF  the condition inside the look-ahead is True. That is to say if, further on, in current line, a colon followed with a second non-null range of word chars, stored as group1 as embedded in parentheses, can be found

                      • In replacement, we rewrite a dot, followed with the contents of group1 ( the country name )

                      Cheers,

                      guy038

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