regex: avoid releasing built RE midloop