So, this verifies it not by looking at actual strings, but by running it through a parser and then seeing if that parser sees the thing in question. The problem there is that that parser could also have issues especially on this edge casde.

I think it's better to do explicit string matching here. What do we expect shouldn't be in the content? What do we expect should be in the content?