Community
    • Login

    Mark every line contains less than 3 dots

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 3 Posters 585 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.
    • Mohammed AsifM Offline
      Mohammed Asif
      last edited by

      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
      • guy038G Offline
        guy038
        last edited by guy038

        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
        • AdrianHHHA Offline
          AdrianHHH
          last edited by

          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
          • Mohammed AsifM Offline
            Mohammed Asif
            last edited by

            thanks, guys it worked, both of your solutions worked

            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