Community

    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    Mark every line contains less than 3 dots

    Help wanted · · · – – – · · ·
    3
    4
    26
    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 Asif
      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
      • guy038
        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
        • AdrianHHH
          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 Asif
            Mohammed Asif last edited by

            thanks, guys it worked, both of your solutions worked

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            Copyright © 2014 NodeBB Forums | Contributors