Minecraft wiki entry for Target_selectors, associated text: [tag=<string>] — Include only targets with the specified tag.
[tag=!<string>] — Exclude any targets with the specified tag.
[tag=] — Include only targets with exactly zero tags.
[tag=!] — Exclude any targets that have at least one tag.