• Login
Community
  • Login

Mark every line contains less than 3 dots

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 3 Posters 285 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.
  • M
    Mohammed Asif
    last edited by Aug 8, 2020, 7:33 AM

    i have a list of ip, but i want to mark every line which contains less than 3 dots(.)

    example:
    220.108.104.67
    220.132.126
    220.135.237.66
    220.135.254.94
    220.181.7
    220.181.19.65
    220.181.19.87

    result:
    i want the line 2 and 5 to be marked(220.181.7 and 220.132.126)

    1 Reply Last reply Reply Quote 0
    • G
      guy038
      last edited by guy038 Aug 8, 2020, 8:17 AM Aug 8, 2020, 8:16 AM

      Hello, @mohammed-asif and All,

      Very easy with regexes !

      • Open the Mark dialog ( Ctrl + M )

      • SEARCH ^\d{1,3}\.\d{1,3}\.\d{1,3}$

      • Tick the Bookmark line option and, preferably, the Wrap around option

      • Select the Regular expression search mode

      • Hit the Mark All button

      Voila !

      An alternate syntax, using a subroutine call to group 1, would be :

      SEARCH ^(\d{1,3})(\.(?1)){2}$

      Best Regards,

      guy038

      1 Reply Last reply Reply Quote 3
      • A
        AdrianHHH
        last edited by Aug 8, 2020, 8:19 AM

        The easy way is to mark all lines with three dots then to invert the bookmarks.

        Open the mark dialogue, ensure “Regular expressions” and “Bookmark line” are selected and that “Dot matches newline is not selected”. Enter the regular expression

        \..*\..*\.
        

        then click “Mark all”.
        The final step is to use menu => Search => Bookmark => Inverse bookmark.

        1 Reply Last reply Reply Quote 4
        • M
          Mohammed Asif
          last edited by Aug 8, 2020, 8:24 AM

          thanks, guys it worked, both of your solutions worked

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