• Login
Community
  • Login

Move word with notpad++

Scheduled Pinned Locked Moved General Discussion
5 Posts 4 Posters 899 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.
  • F
    faouzi sat
    last edited by Jan 31, 2023, 7:30 AM

    I have this :
    :10001 80.241.223.31
    :5500 89.44.113.207
    :5555 164.142.44.189
    :5500 80.241.154.87
    :20000 142.227.138.30
    :7777 5.240.23.28
    :7777 78.41.71.186
    :5500 38.242.243.181

    i want to get Ip:port
    like this :

    80.241.223.31:10001
    89.44.113.207:5500
    164.142.44.189:5555
    80.241.154.87:5500
    142.227.138.30:20000
    5.240.23.28:7777
    78.41.71.186:7777
    38.242.243.181:5500

    T P 2 Replies Last reply Jan 31, 2023, 7:58 AM Reply Quote 0
    • T
      Terry R @faouzi sat
      last edited by Jan 31, 2023, 7:58 AM

      @faouzi-sat said in Move word with notpad++:

      i want to get Ip:port
      like this :

      So what have you tried? It is a fairly easy one to solve using regular expression and should be one that even someone who has had little experience, to be able to solve.

      Terry

      A 1 Reply Last reply Jan 31, 2023, 12:14 PM Reply Quote 0
      • A
        Alan Kilborn @Terry R
        last edited by Jan 31, 2023, 12:14 PM

        @Terry-R

        But maybe really difficult for someone with absolutely no exposure to regular expressions?

        1 Reply Last reply Reply Quote 0
        • P
          PeterJones @faouzi sat
          last edited by Jan 31, 2023, 2:13 PM

          @faouzi-sat ,

          Here’s your freebie, since this was your first post. And I appreciate that you showed before-and-after data, even if you neglected the </> button to mark your text as plaintext. But as Terry was encouraging you, you will get better help (and learn more) if you put in more effort when asking for help.

          So, in Regular Expression search mode,

          • : matches a literal colon
          • \d+ matches one or more digits
          • \. matches a literal dot/period/fullstop character
          • putting () parentheses around an expression will save it in the next capture group number

          And in the replacement, $1 references the first capture group number.

          Putting that all together: put a colon and one or more digits in group#1 and the sequence of digits-dot-digits-dot-digits-dot-digits in group#2, and replace with group2-then-group1

          • FIND = (:\d+) (\d+\.\d+\.\d+\.\d+)
          • REPLACE = $2$1

          ----

          Useful References

          • Please Read Before Posting
          • Template for Search/Replace Questions
          • Formatting Forum Posts
          • Notepad++ Online User Manual: Searching/Regex
          • FAQ: Where to find other regular expressions (regex) documentation
          F 1 Reply Last reply Jan 31, 2023, 2:49 PM Reply Quote 0
          • F
            faouzi sat @PeterJones
            last edited by Jan 31, 2023, 2:49 PM

            @PeterJones said in Move word with notpad++:

            @faouzi-sat ,

            Here’s your freebie, since this was your first post. And I appreciate that you showed before-and-after data, even if you neglected the </> button to mark your text as plaintext. But as Terry was encouraging you, you will get better help (and learn more) if you put in more effort when asking for help.

            So, in Regular Expression search mode,

            • : matches a literal colon
            • \d+ matches one or more digits
            • \. matches a literal dot/period/fullstop character
            • putting () parentheses around an expression will save it in the next capture group number

            And in the replacement, $1 references the first capture group number.

            Putting that all together: put a colon and one or more digits in group#1 and the sequence of digits-dot-digits-dot-digits-dot-digits in group#2, and replace with group2-then-group1

            • FIND = (:\d+) (\d+\.\d+\.\d+\.\d+)
            • REPLACE = $2$1

            ----

            Useful References

            • Please Read Before Posting
            • Template for Search/Replace Questions
            • Formatting Forum Posts
            • Notepad++ Online User Manual: Searching/Regex
            • FAQ: Where to find other regular expressions (regex) documentation

            Working !

            thanks

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