It is not possible to compile PHP without regex even when using the build flag --without-regex. Instead, regex will always be included as if set --with-regex.
This seems rather strange to me, since (POSIX) regex support is deprecated as of PHP 5.3, according to the documentation. Does anybody know the reason for this inconsistent behaviour? Does anybody have experience in disabling this extension? Wouldn't it be desirable to be able to disable regex in order to prevent further usage (this was my orginal intent).