So I am pretty new to what I currently refer to as advanced RegEx, please pardon me, it's probably really easy for you guys but I need to be pointed in the right direction because right now I am struggling. I have crawled the forums and websites, (including: http://www.grymoire.com/Unix/Sed.html) and I can't find what I am looking for or at least, the reverse so I then reverse that and get the stdout that I want.The data (stdin) looks like this:C:\Users\Maison\Documents\AutoCad_dirTrueFalse01UserGroupEveryoneFull AccessS-I-DC:\Users\Maison\DocumentsTrueFalse01UserGroupEveryoneFull AccessS-I-DAnd what I want to do is using RegEx, remove every line with 4 directories or more and the proceeding 10 lines (including the CR \r).So what remains will look something like this:C:\Users\Maison\DocumentsTrueFalse01UserGroupEveryoneFull AccessS-I-DNOTE: The volume label (C:) is not constant, no data I am working with is absolute.Of course in the actual data I possess, there are a lot more lines similar to the one I am trying to erase.The best I have so far is: sed '/pattern/I,+11 d' infileBut I cannot come up with a logical pattern, every pattern I have come up with so far erases every line regardless of directory count.I was reluctant to ask but this ultimately will allow me to understand RegEx & GNU sed better.
RegEx match + additional line removal
awk;sed;regular expression;cat;gnu