So I have this really long file in which there are lines that are built like this:
`somecode [ somecode > somecode ] somecode > somecode > somecode`
I have to search for a string of atleast 9 + or – characters between the brackets and the same thing that was matched between those brackets have to be found between the two ‘>’ next to the brackets…
So far I came up with this;
`cat file | egrep -n '*\[.*([-+]{9,}).*\].*(>).*\1.*(>).*' > out.txt`
i guess from your regex,this is what you wanted to do
if you want to get the full line use this