The problem is the following:
I have a document called brain.txt with lines of characters like this:
++++++++++[>++++++++>++++++>+<<<-]>+++.>+++++.<-.+.>>. word
The word at the end can really be any word.
How can i filter the lines from the document where every 7th character is a plus?
example: +......+......+......+..... word
I wrote the following command:
egrep '^\+(.{6}\+)+.{,6}\s' brain.txt
But it does not seem to work, can anyone explain me what is incorrect about this command please?
The problem is the shorthand notation
{,6}which does not seem to work with the given regex flavor. Simply write it out:Note that this requires at least 2
+s. The single\+at the beginning, and another one in the subpattern (because it is repeated at least once). If+.... wordwould be a valid line for you, use: