Community
    • Login

    Keeping urls and deleting rest of the stuff from copied sourcecode.

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    7 Posts 3 Posters 584 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.
    • R kR
      R k
      last edited by

      Hey,
      I have source code of webpage, I only want to keep all links matching
      https://d1a0n9gptf7ayu.cloudfront.net/photos/*.jpg links and delete rest of the code and save file.
      How i can do that?

      1 Reply Last reply Reply Quote 1
      • EkopalypseE
        Ekopalypse
        last edited by

        @R-k said in Keeping urls and deleting rest of the stuff from copied sourcecode.:

        depends, what exactly you want to achieve.
        Do you want to delete ANY text except these links?
        Or do you want to delete all lines having not the links?

        1 Reply Last reply Reply Quote 0
        • R kR
          R k
          last edited by

          every thing is mixed up, its a 3000 line source code,

          <li class=“photo-container” id=“thumb-29” data-index=“29” data-album-photo-id=“11730949”>
          <a href=“https://d1a0n9gptf7ayu.cloudfront.net/photos/cda5bc6dcb6823c052a593959d5621.jpg”>

          1 Reply Last reply Reply Quote 1
          • EkopalypseE
            Ekopalypse
            last edited by

            I’ll give it a try in German as your avatar is Sebastian Vettel :-)

            Soll jeglicher Text, außer den Links, gelöscht werden oder
            sollen nur die Zeilen, welche nicht die Links enthalten gelöscht werden?

            Should any text, except for the links, be deleted or
            should only the lines that do not contain the links be deleted?

            1 Reply Last reply Reply Quote 0
            • R kR
              R k
              last edited by

              All text, except for the links, be deleted.

              thats what i want.

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

                OK, two step process

                Open find dialog and select Mark tab.
                Use this in find what:(.*)(https://d1a0n9gptf7ayu.cloudfront.net/photos/.*\.jpg)(.*)
                Check bookmark line and press Mark All
                Keep the dialog open but go to Search->Bookmark->Remove Unmarked Lines
                Then select Replace tab and add this to replace with:$2
                and press Reaplce All

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

                  It is sometimes difficult to keep certain text by trying to match the remaining text, usually because the remaining text is hard to match because it may not be as patterned as the “to keep” text.

                  @guy038 discusses a technique to do this kind of text retention in this thread. Probably could be adapted to work well here.

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