the trick is to use multiple results, this will let you use the same dice pool more than once in an expression.
For your example, I would use:
a=5d10!, a#{>5}-a#{1}
This will roll your 5d10 with exploding behaviour and call it “a” (you could call it whatever you want), then we count the number of dice that rolled over 5 in “a”, and then subtract the count of dice that rolled 1 in “a”.
Hope that helps!