Community
    • Login

    replace / character after speciffic word

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    3 Posts 2 Posters 790 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.
    • Vio VioV
      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
        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
          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
          • First post
            Last post
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors