Right, but that's not relevant, because the script would still execute both matches (especially if they fail) to be comparable to the code posted by the OP. According to the example posted above, this would be the equivalent code:

Code:
var %x = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
if ($regex(%x, /(\D+|<\d+>)*[!?]/)) goto end
if ($regex(%x, /(\D++|<\d+>)*[!?]/)) goto end
echo -a fail.
:end


Notice that you're still executing the longer-to-process regex, but you're also compiling each regex separately which is far less efficient because of the overhead to actually compile the regex.

My point is that it will probably be faster to compile and process only one regex where the sub regexes in question are relatively similar in complexity, ex:

Code:
var %x = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
if ($regex(%x, /(\D++|\D+|<\d+>)*[!?]/)) goto end
echo -a fail.
:end


I bet if benchmarked, the second code block would win. And that probably holds true for any N $regex's assuming the complexity of each expression is similar.