How do I handle rerolls for Savage Worlds

I know the Wildcard rolls function like this output [highest of [explode 1d6] and [explode 1d6]] How can I factor in a reroll? Assuming I miss the target number of 4, reroll the output [highest of [explode 1d6] and [explode 1d6]].

Everything I try does not run…