Improve test tag string parsing