ResourceFunction[ &quot;CatchAll&quot;][{1, h[r], Style[&quot;x&quot;, 5]} /. s_String :&gt; Throw[s]
ResourceFunction[
 &quot;CatchAll&quot;][{1, h[r], Style[&quot;x&quot;, 5]} /. s_String :&gt; Throw[s]]