Mark every line contains less than 3 dots



  • 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)



  • 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



  • 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.



  • thanks, guys it worked, both of your solutions worked


Log in to reply