The best part of sam are the structural regular expressions. I keep a copy installed just for them. Now admittedly I never use it enough to get good at it so every time it is usually 10 minutes swearing at the manual.
The standard unix regular expression implementations (grep, sed, ed, vi) are very tied to "lines" of text, and most of the time this is exactly what you want. but sometimes it gets in the way. And when you start to have trouble with your regex because it is conflicting with line returns, then it is the sam editor and it's structural regex engines time to shine. They would probably be great elsewhere, but nobody else uses them.
Have you tried vis?
https://github.com/martanne/vis