T
T
tareid2019-06-03 00:33:32
Notepad++
tareid, 2019-06-03 00:33:32

How to select lines from text by parameters?

Hello, help.
Text 5k lines, in alphabetical order. You need to save the first 3 lines of each letter of the alphabet. Given the first 2 characters of the string.
It should look like this
: at58
at59
at60
au344
au347
au348
ba5
ba6
ba7
be72
be73
be74

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
dodo512, 2019-06-03
@tareid

https://regex101.com/r/SgMRfT/1
Find: (?m-s)^(..).*+(?>\r?\n\1.*){2}\K(?:\r?\n\1.*)+
And leave the replacement string empty.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question