I've got a file with QR-code lines and I want to grep for only those whose subsequences do not increase in length. Example: This one is good because the next sequence is less or same as previous:####### ###### ### ### ## # # #This one is wrong:### ## ## ### ### ### ###### ##I started off like this:egrep [^#](####)+[ ]+(##)+ qr.txtbut then I realised it's going to be impossible to continue..
Match the next pattern which is less than the previous match
regular expression;patterns
grep -vE '(^| )(#+) .*\2#' <<END####### ###### ### ### ## # # #### ## ## ### ### ### ###### ##END####### ###### ### ### ## # # #