Community
    • Login

    Search with wildcards

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    11 Posts 3 Posters 1.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.
    • Diego SabahD
      Diego Sabah
      last edited by

      Hi all.

      I want to search and replace in a text file all the text that starts with <table and ends with </table>.

      Can someone help me how to do it using regular expressions in notepad ++?

      Thank you!!

      D.

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Diego Sabah
        last edited by

        @Diego-Sabah

        I’d certainly give this a go as a first shot:

        Find (?s)<table>.*?</table>
        Replace wtf_knows
        Search mode: Reg. expression

        Diego SabahD 1 Reply Last reply Reply Quote 3
        • Diego SabahD
          Diego Sabah
          last edited by

          Hello Alan Kilborn that exprecion worked impeccable !!! Thank you very very much!!

          I need help with another expression more please.
          I want to find and replace all the text that starts with <img have in the middle youtube.com and end with >

          Can someone help me how to do it using regular expressions in notepad ++?

          Meta ChuhM 1 Reply Last reply Reply Quote 0
          • Meta ChuhM
            Meta Chuh moderator @Diego Sabah
            last edited by

            @Diego-Sabah

            I need help with another expression more please.

            i could literarily smell this coming 😂

            find what: <img(.*?)youtube.com(.*?)>
            replace with: wtf_knows

            best regards

            Diego SabahD 1 Reply Last reply Reply Quote 1
            • Diego SabahD
              Diego Sabah @Alan Kilborn
              last edited by

              Hello @Alan-Kilborn that exprecion worked impeccable !!! Thank you very very much!!

              I need help with another expression please.
              I want to find and replace all the text that starts with <img have in the middle youtube.com and end with >

              Can someone help me how to do it using regular expressions in notepad ++?

              Meta ChuhM 1 Reply Last reply Reply Quote 0
              • Meta ChuhM
                Meta Chuh moderator @Diego Sabah
                last edited by

                @Diego-Sabah

                I need help with another expression more please.

                i could literarily smell this coming 😂

                find what: <img(.*?)youtube.com(.*?)>
                replace with: wtf_dejavu

                best regards

                1 Reply Last reply Reply Quote 1
                • Diego SabahD
                  Diego Sabah @Meta Chuh
                  last edited by

                  Hi @Meta-Chuh said:

                  <img(.?)youtube.com(.?)>

                  THANK YOU for your quick response Meta Chuh.

                  Your solution works for me for some cases, but for other cases it does not.

                  It does not work for the cases I have two images together. The first of the domain google.com and the second of the searched domain (in this case youtube.com)

                  Example :
                  <img src = "http: //www.google.com/imagenes/123.jpg ">
                  <img src = “http: //www.youtube.com/imagenes/456.jpg”>

                  I want to select only:
                  <img src = “http: //www.youtube.com/imagenes/456.jpg”>

                  But in practice, notepad selects :

                  <img alt = src = "http: //www.google.com/imagenes/123.jpg ">
                  <img alt = src = "http: //www.youtube.com/imagenes/456.jpg ">

                  I appreciate your support

                  From already thank you very much!!

                  Meta ChuhM 1 Reply Last reply Reply Quote 1
                  • Meta ChuhM
                    Meta Chuh moderator @Diego Sabah
                    last edited by Meta Chuh

                    @Diego-Sabah

                    please disable . matches newline at the search mode settings.

                    Diego SabahD 2 Replies Last reply Reply Quote 3
                    • Diego SabahD
                      Diego Sabah @Meta Chuh
                      last edited by

                      @Meta-Chuh

                      It works like a charm. You’re a genius!!!

                      1 Reply Last reply Reply Quote 1
                      • Diego SabahD
                        Diego Sabah @Meta Chuh
                        last edited by Diego Sabah

                        Dear @Meta-Chuh , I hope that you are very well.

                        The solution you gave me worked for most of the cases.

                        However some of the images that I have are in the text like this:

                        <img alt=“”
                        src=“http://www.mysite.com/imagenes/image.jpg”>

                        and the above solution does not work.
                        Any other idea?

                        Best regards!!

                        Meta ChuhM 1 Reply Last reply Reply Quote 0
                        • Meta ChuhM
                          Meta Chuh moderator @Diego Sabah
                          last edited by

                          @Diego-Sabah

                          find what: <img alt(.*?)("|"\r\n|"\n)(.*?)mysite.com(.*?)$
                          replace with: your_content

                          note: keep . matches newline disabled at the search mode settings, to avoid multi line matches.

                          best regards.

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