Minecraft wiki entry for Argument_types, associated text: block_id is required, and it should be in the format of resource location(if namespace isn't set it defaults to minecraft:).
It can also be the resource location of a block tag prefixed with #, such as #minecraft:planks.
Block states are inside [], comma-separated and must be properties/values supported by the blocks. They are optional.
minecraft:stone[doesntexist=purpleberry] is unparseable, because stone doesn't have doesntexist.
minecraft:redstone_wire[power=tuesday] is unparseable, because redstone_wire's power is a number between 0 and 15.
Data tags are inside {}. It's optional.
When test for block, only the states provided are tested.
If command tests redstone_wire[power=15], it checks only power, but ignores other states such as north.