This is the input: asdfZE3033141xycfasdfINSFRHxycfand I need this output: asdfZE3033141asdfINSFRHxycfSo I used a: echo -e 'asdfZE3033141xycf\nasdfINSFRHxycf' | sed '/asdfZE3033141xycf/ s=xycf$=\n='but I need this in GENERAL. So I need to sed every: asdfZE[0-9][0-9][0-9][0-9][0-9][0-9][0-9]xycfline in a textfile. I just can't put the [0-9] in sed. How can I do this? 
How to sed lines that contain only given form?
bash
Why do not modify your work a little bit:echo -e 'asdfZE3033141xycf\nasdfINSFRHxycf' | sed -e 's/^\(asdfZE[0-9]\{7\}\)xycf$/\1\n/'