• Login
Community
  • Login

mark the lines that you have n characters

Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
4 Posts 3 Posters 744 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.
  • V
    Vivianjenylord
    last edited by Apr 27, 2019, 3:45 PM

    friends how can I mark the lines that have 6 characters after the colon (:)

    c.pardi@inconu.com :abcdef
    emmanuel.brounidd7@fixe.com:12345daxs
    contact@jamaka.com :@23411
    dbpoloul@hik.com :aaasdfex
    michel.ours@yahoo.com:12qwas

    to

    c.pardi@inconu.com :abcdef
    contact@jamaka.com :@23411
    michel.ours@yahoo.com:12qwas

    M 1 Reply Last reply Apr 27, 2019, 8:08 PM Reply Quote 0
    • G
      guy038
      last edited by guy038 Apr 27, 2019, 7:59 PM Apr 27, 2019, 7:55 PM

      Hello, @Vivianjenylord and All,

      You said :

      friends how can I mark the lines that have 6 characters after the colon (:)

      I suppose that you meant :

      friends how can I mark and delete the lines that do not have exactly 6 characters after the colon (:) ;-))

      If so, from your original text :

      c.pardi@inconu.com:abcdef
      emmanuel.brounidd7@fixe.com:12345daxs
      contact@jamaka.com:@23411
      dbpoloul@hik.com:aaasdfex
      michel.ours@yahoo.com:12qwas
      
      • Open the Replace dialog ( Ctrl + H )

      • SEARCH (?-s)(?!.+:.{6}\R)^.+\R    OR     (?-s)^.+:(.{0,5}|.{7,})\R

      • REPLACE Leave EMPTY

      • Tick, preferably, the Wrap around option

      • Select the Regular expression search mode

      • Click, once, on the Replace All button or several times on the Replace button

      You should obtain your expected text :

      c.pardi@inconu.com:abcdef
      contact@jamaka.com:@23411
      michel.ours@yahoo.com:12qwas
      

      Notes :

      • The in-line modifier, (?-s), at the beginning of the two regexes, means that any further dot ( . ) represents a single standard character, only and not an EOL one !

      • The first syntax looks for a complete non-null line, with its EOL character(s) ( ^.+\R ), but ONLY IF the negative look-ahead ( (?!.+:.{6}\R) ) is satisfied, i.e. it does not exist a colon, after some chars, followed with, exactly, six standard characters, themselves followed with a line-break

      • The second syntax looks from a non-null range of standard characters, till a colon character, followed with a range of standard chars between 0 and 4 or from 7 and above

      Best Regards

      guy038

      V 1 Reply Last reply Apr 28, 2019, 1:22 AM Reply Quote 3
      • M
        Meta Chuh moderator @Vivianjenylord
        last edited by Meta Chuh Apr 27, 2019, 8:09 PM Apr 27, 2019, 8:08 PM

        @Vivianjenylord @guy038 et al.

        this looks to me like a case, where it is wished to process (or remove) all user accounts, which do not match your password requirements.

        if this is the case, we would also need your specific needs and requirements for those user accounts, as well as how you would have thought to treat them, e.g. after marking.

        shall your passwords only be allowed to have 6 chars, or do you want to remove them as too short ?

        best regards.

        1 Reply Last reply Reply Quote 2
        • V
          Vivianjenylord @guy038
          last edited by Apr 28, 2019, 1:22 AM

          @guy038 so is friend, I help a lot the Regular expression, I thank you very much for your help

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