fix some "#if without expression" errors

That was caused because the command line flag to define HAVE_REGEX
should only be added if HAVE_REGEX is set to true...