I'm not sure this check is sufficient.  What if I have `foo=bar lolhost=42host hosthost=hosthost`?

Sounds like you need to check at least `" host=" not in tags`.  Please use double quotes (`"`) for your strings in order to be consistent with the rest of the code.