To explain a little more:
The first .contains stores the entire matching expression in $0, and the matched back reference in $1, as usual.
The second .contains then stores it’s full matching expression in the next slot, $2, and its back reference in $3.
This scheme is not intuitive, to be sure. It does, however, support multiple pattern matches in an expression:
if($Name.contains(..something..) | $Text.contains(..something else..))
We’re exploring alternatives. As a general hint, though, I find that when rules or actions become elaborate, that’s often a sign that they want to become several rules, or perhaps several agents.