<div dir="ltr">I'm using sed to massage some input. Specifically, I have input lines like<div><br></div><div>aaaaaaaaaa/BBBBB_ccc@00000</div><div>or</div><div>aaaaaaaaaa/BBBBB@00000</div><div><br></div><div>and I want the output to always be</div><div><br></div><div>BBBBB</div><div><br></div><div>I've got most of it, but I can't figure out how to get rid of anything at the end of the line after EITHER the underscore OR the '@' (including either of those two characters).</div><div><br></div><div>Is this possible in one expression in sed? I can do it with piping the input through sed twice but I was wondering if one pass would do it. Currently I'm using</div><div><br></div><div>sed "s/^.*\/\(.*\)[_@].*$/\1/"<br></div><div><br></div><div>Which doesn't get rid of the "_ccc" when it appears, just the "@00000".</div><div><br></div><div>Suggestions?</div></div>