Community
    • Login

    replace / character after speciffic word

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 1.4k 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.
    • Vio VioV Offline
      Vio Vio
      last edited by Vio Vio

      Hello to everyone.
      Can someone please help me achieving this in notepad++ :

      from this
      url://dns1:8080/get.php?username=pablo/abcdxx&type=m3u
      url://dns7:8080/get.php?username=nadia/werdftd&type=m3u
      url://dns3:8080/get.php?username=sofia/aduduew&type=m3u

      to this

      url://dns1:8080/get.php?username=pablo&password=abcdxx&type=m3u
      url://dns7:8080/get.php?username=nadia&password=werdftd&type=m3u
      url://dns3:8080get.php?username=sofia&password=aduduew&type=m3u

      that would be to replace “/” (found after word “username=” and before word “&type”) with “&password=” in all lines.

      thank you

      1 Reply Last reply Reply Quote 0
      • guy038G Offline
        guy038
        last edited by guy038

        Hello, @vio-vio and All,

        Here my solution :

        • Open the Replace dialog ( Ctrl + H )

        • Uncheck all box options

        • SEARCH /(?=\w+&type)

        • REPLACE &password=

        • If necessary, check the Wrap around option

        • Check the Regular expression option

        • Click on the Replace All button


        I assume that all the passwords are only composed of letters, as shown in your example. If not, just tell me which non-letters chars may be part of a password !

        You may also try this second search expression which allows any char, other than the / and the EOL characters, as password char !

        • SEARCH /(?=[^/\r\n]+&type)

        Best Regards,

        guy038

        Vio VioV 1 Reply Last reply Reply Quote 0
        • Vio VioV Offline
          Vio Vio @guy038
          last edited by

          @guy038 said in replace / character after speciffic word:

          /(?=[^/\r\n]+&type)

          Thank you very much.work as needed.
          no,i don’t think other then words/numbers in password are used. just to make sure added some and used second option,worked as needed to.
          Thank you again,this topic can be closed.

          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