This can be enforced by pre-commit, but correct it separately to make it easier to review.
This feature is controlled at compile time by MICROPY_PY_URE_SUB, disabled by default. Thanks to @dmazzella for the original patch for this feature; see #3770.