This reverts commit 62c3e4ab9c. Needs more work, see comments about `_regex_free` errors in #70447.
62c3e4ab9c