I have a file like below:
chs_de_le_q1gg
fd_tr_mn_0
fd_tr_mn_06
fd_tr_mn_070
fd_tr_mn_0716
fd_tr_mn_09013
fd_tr_mn_092433
fd_tr_mn_1020333
fd_tr_mn_12013332
dsdas_1
dsdas_12
dsdas_212
sdasd_4567
weqwe_32323
dasds_232322
2321321_rewrwe_3233
32_Ff
asdasd_1_fff
I need to remove the lines ending with digits ranging from 4-8 of length; also to remove lines starting from numbers.
the below works to match the lines which I want to delete, but then doing invert match on that match with adding -iv
doesn't work.
cat test.txt | grep -oP '(?<![0-9])[0-9]{4,8}(?![0-9])'