> if the regime is actually somehow magically removed I don't think attacking Israel would be a high priority
Attacking Israel hasn't been a high priority for Iran. When Israel bombed an Iranian consulate, Iran referred it to the security council and waited, but the security council took no action. When Israel carries out an assassination within Iran, Iran did the same thing. Only after the UN refused to do anything to hold Israel to account did Iran retaliate. Then recently Israel launched a massive series of strikes against Iran, assassinating top members of its military and blowing up apartment buildings. It seems clear that the Iranian government didn't want to go to war with Israel, but at a certain point they ran out of options.
First letter: https://digitallibrary.un.org/nanna/record/4043282/files/A_7...
Second letter: https://digitallibrary.un.org/nanna/record/4055716/files/S_2...