The antigens don't match on DNA segments. They match on proteins that the virus has on it. The mRNA sequence is specific to produce that very particular pattern. Not a wildcard.
They have no way to access the underlying DNA.
The BioNtech-Vaccine accounts for this afaik, to prevent the spike-proteins from clumping.
So, even further from regex. The RNA gets turned into a sequence of amino acids, which folds in an extremely complex 3D shape, which bind together with two other proteins to form a large structure, the full shape of which is matched by antibodies.
1. https://www.nytimes.com/interactive/2020/health/pfizer-biont...