Performance of selecting strings: substring IN vs regular expression
The version with IN will be slightly faster, because = ANY is cheaper than ~.
The estimate suggests otherwise, but only because it estimates a different number of result rows.
You can make these queries faster with an index on the more selective condition.