Use mpdm_string() instead of r->data in regex_flags().