I want to transform this text (remove .*?) with sed, awk or perl:
.*?
{| |- | colspan=\"2\"| : [\\underbrace{\\col
If all data is so nicely formatted as in your example, then your solution is very close. I modified it only slightly
in AWK:
sub(/.*/, "") {print; cut=1} /<\/math>/ {cut=0; next} !cut