Community
    • Login

    Searching all lines between tags

    Scheduled Pinned Locked Moved General Discussion
    2 Posts 2 Posters 956 Views 1 Watching
    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.
    • pppps_0202P Offline
      pppps_0202
      last edited by

      I would like to copy all the lines between <a href… </a> from a old html file, is there a smarter way using the search tool?

      Terry RT 1 Reply Last reply Reply Quote 0
      • Terry RT Offline
        Terry R @pppps_0202
        last edited by

        @tss-tss said in Searching all lines between tags:

        I would like to copy all the lines between <a href… </a> from a old html file, is there a smarter way using the search tool?

        When you say copy between I would presume the line would also contain the <a href… and </a> code as well. that is unless the lines are formatted in such a way as to have this code on lines by themselves and the lines you want are indeed ‘between’.

        So using the Mark function (Search, Mark, Ctrl+M default shortcut) you would add the following to the find field:
        Find What:(?s)<a href>.+?</a>
        Tick the box “bookmark line”, search mode is regular expression. Click on “Mark All”. You will now see lines that you want to copy are preceded by a blue circle/sphere. These are the bookmarks. Then Right click on this area and select “Copy Bookmarked Lines”. Create a new tab and insert those lines using Ctrl-V (paste).

        If you need a definition of the regular expression please just ask.

        Terry

        1 Reply Last reply Reply Quote 1

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        • First post
          Last post
        The Community of users of the Notepad++ text editor.
        Powered by NodeBB | Contributors