configure: Use regex_replace to check for HAVE_STD_REGEX.