in reply to Matching and nonmatching multiple regexps at once
For single characters, add this to your benchmark, it is faster than the 3-regex method:
x => sub {/^(?:[ac]|[^b])+$/s},
I realise that yours are more general and should handle more than single characters, but if that is your target application, you shouldn't be using single chars in your benchmark as it is quite likely to give you false expectations.
|
---|