Tiny optimization for std.regex

A non-controversial part of pull #1553