mark the lines that you have n characters

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


  • 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 :
    • Open the Replace dialog ( Ctrl + H )

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


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

    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


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

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

Log in to reply