Community
    • Login

    Keep only specific links

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.2k 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.
    • T CT
      T C
      last edited by

      Hi.

      How can I keep links like this:

      https://archiveofourown.org/works/120628

      and not links like these:

      https://archiveofourown.org/works/120628#comments
      https://archiveofourown.org/works/120628/bookmarks
      https://archiveofourown.org/works/120628?show_comments=true#comments

      Thanks so much

      Scott SumnerS 1 Reply Last reply Reply Quote -1
      • Scott SumnerS
        Scott Sumner @T C
        last edited by

        @T-C

        What you want is a little loosely defined. For example, this will do it, but I sense you want something more generic over the whole expression:

        Find what zone: (?-s)https://archiveofourown\.org/works/120628(?=[#/?]).+\R
        Replace with zone: make sure this is EMPTY
        Search mode: Regular expression

        It also assumes that the lines end where shown above by the OP, but this is somewhat of an arbitrary assumption…

        Hmmm…don’t know that this actually deserves a down-vote…whomever did that…

        1 Reply Last reply Reply Quote 0
        • T CT
          T C
          last edited by

          Another option was to mark lines that had only links like this:

          https://archiveofourown.org/works/14272356

          The numbers in bold are different every time.

          Scott SumnerS 1 Reply Last reply Reply Quote 0
          • Scott SumnerS
            Scott Sumner @T C
            last edited by

            @T-C

            Again, what you are trying to achieve is vague. You’re not going to get the best help that way (and you may even get down-voted again).

            So…first you wanted to delete text, now you want to mark text…which is it?

            You can match a number that is different every time by using \d+ in the expression where the number occurs.

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