diff --git a/librz/util/regex.c b/librz/util/regex.c index 0abc5c4e9c..a187f23245 100644 --- a/librz/util/regex.c +++ b/librz/util/regex.c @@ -1458,6 +1458,14 @@ RZ_API RzRegexFlags rz_regex_parse_flag_desc(RZ_NULLABLE const char *re_flags_de flags |= RZ_REGEX_LITERAL; goto return_flags; } + if (strchr(re_flags_desc, 'd')) { + fcount++; + flags |= RZ_REGEX_DOTALL; + } + if (strchr(re_flags_desc, 'm')) { + fcount++; + flags |= RZ_REGEX_MULTILINE; + } if (strchr(re_flags_desc, 'r')) { fcount++; goto return_flags; @@ -1470,14 +1478,6 @@ RZ_API RzRegexFlags rz_regex_parse_flag_desc(RZ_NULLABLE const char *re_flags_de fcount++; flags |= RZ_REGEX_EXTENDED_MORE; } - if (strchr(re_flags_desc, 'm')) { - fcount++; - flags |= RZ_REGEX_MULTILINE; - } - if (strchr(re_flags_desc, 'd')) { - fcount++; - flags |= RZ_REGEX_DOTALL; - } return_flags: if (fcount != strlen(re_flags_desc)) { RZ_LOG_ERROR("Flag combination '%s' is invalid.\n", re_flags_desc);