How to remove lines that not containing any uppercase letters or lowercase letters or numbers notepad++

notepadsublime-text-2sublime-text-3text editingtext-editors

I want to keep only lines that contain

at least 1 uppercase letter

at least 1 lowercase letter

at least 1 number

Example:

:soTest.@1rTr
:$TEST%.TER12TB&
:-G5O6D$G%R@RS
:sbg^45re$55
:@65RR$#955
:*S.baR5t6s

Result:

:soTest.@1rTr
:*S.baR5t6s

so the idea that if the whole line in any position after : not contain any of both uppercase letters and lowercase letters and a number remove it or bookmark it or vice versa

Best Answer

I recommend you to use regexp for this. I am not used to notepad++, but ctrl+H should open replace. (I've tried the following on sublime text 3)

^(?!(^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).+$)).*$

This should match all those that are not part of the result.

^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9]).+$

This should match lines that are part of the result. So match lines not part of the result and replace them with the empty string

Related Question