• Login
Community
  • Login

Searching all lines between tags

Scheduled Pinned Locked Moved General Discussion
2 Posts 2 Posters 727 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.
  • P
    pppps_0202
    last edited by May 24, 2022, 3:10 AM

    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?

    T 1 Reply Last reply May 24, 2022, 3:23 AM Reply Quote 0
    • T
      Terry R @pppps_0202
      last edited by May 24, 2022, 3:23 AM

      @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
      2 out of 2
      • First post
        2/2
        Last post
      The Community of users of the Notepad++ text editor.
      Powered by NodeBB | Contributors