apply span formatting per capture group
test nested capture groups