Community
    • Login

    Keep only specific links

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.5k Views 2 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.
    • T CT Offline
      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 Offline
        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 Offline
          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 Offline
            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

            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